| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentBoards\App\Models; |
| 4 |
|
| 5 |
class NotificationUser extends Model |
| 6 |
{ |
| 7 |
protected $table = 'fbs_notification_users'; |
| 8 |
|
| 9 |
protected $guarded = ['id']; |
| 10 |
|
| 11 |
protected $fillable = [ |
| 12 |
'notification_id', |
| 13 |
'user_id', |
| 14 |
'marked_read_at' |
| 15 |
]; |
| 16 |
|
| 17 |
public static function boot() |
| 18 |
{ |
| 19 |
parent::boot(); |
| 20 |
static::creating(function ($model) { |
| 21 |
$model->created_at = current_time('mysql'); |
| 22 |
$model->updated_at = current_time('mysql'); |
| 23 |
}); |
| 24 |
} |
| 25 |
|
| 26 |
public function notification() |
| 27 |
{ |
| 28 |
return $this->belongsTo(Notification::class,'notification_id','id'); |
| 29 |
} |
| 30 |
|
| 31 |
} |
| 32 |
|