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