26 lines
584 B
PHP
26 lines
584 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class Notification extends Model
|
||
|
|
{
|
||
|
|
public $incrementing = false;
|
||
|
|
protected $keyType = 'string';
|
||
|
|
public $timestamps = false;
|
||
|
|
|
||
|
|
protected $fillable = ['id', 'user_id', 'type', 'data', 'read_at', 'created_at'];
|
||
|
|
protected $casts = [
|
||
|
|
'data' => 'array',
|
||
|
|
'read_at' => 'datetime',
|
||
|
|
'created_at' => 'datetime',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function user(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class);
|
||
|
|
}
|
||
|
|
}
|