This commit is contained in:
Muhammad Tamir
2025-11-14 10:59:24 +07:00
parent 85c03cef82
commit b3933b9960
505 changed files with 13811 additions and 2341 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Models;
use App\Observers\NotificationObserver;
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
#[ObservedBy([NotificationObserver::class])]
class Notification extends Model
{
protected $fillable = [
'user_id',
'title',
'body',
'url',
];
public function user()
{
return $this->belongsTo(User::class);
}
public function markAsRead()
{
$this->read_at = now();
$this->save();
}
}