1 | <?php |
||
18 | class Notification extends Model |
||
19 | { |
||
20 | protected $table = 'notification__notifications'; |
||
21 | protected $fillable = ['user_id', 'type', 'message', 'icon_class', 'link', 'is_read', 'title']; |
||
22 | protected $appends = ['time_ago']; |
||
23 | protected $casts = ['is_read' => 'bool']; |
||
24 | |||
25 | /** |
||
26 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
27 | */ |
||
28 | public function user() |
||
34 | |||
35 | /** |
||
36 | * Return the created time in difference for humans (2 min ago) |
||
37 | * @return string |
||
38 | */ |
||
39 | public function getTimeAgoAttribute() |
||
43 | |||
44 | public function isRead() : bool |
||
48 | } |
||
49 |