Update channels model to set default icon in the event that one doesn't exist, as described in #55
This commit is contained in:
parent
d3b4fd851b
commit
a50c117a98
@ -30,4 +30,10 @@ class Channels extends Model
|
|||||||
public $hasMany = [
|
public $hasMany = [
|
||||||
'feeditems' => ['jasonwilliams\feed\Models\FeedItem', 'key' => 'channel_id']
|
'feeditems' => ['jasonwilliams\feed\Models\FeedItem', 'key' => 'channel_id']
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function afterFetch()
|
||||||
|
{
|
||||||
|
// Add a default icon if there isn't one already
|
||||||
|
if (!$this->icon) $this->icon = "fas fa-sticky-note";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user