27 خطوط
541 B
PHP
27 خطوط
541 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Notification extends Model
|
|
{
|
|
protected $fillable = ['user_id', 'title', 'message', 'type', 'data', 'is_read'];
|
|
|
|
protected $table = 'internal_notifications';
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'data' => 'array',
|
|
'is_read' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|