Files
Paymenter-Version-Tracks/app/Models/Notification.php
Muhammad Tamir b3933b9960 v1.4.0
2025-11-14 10:59:24 +07:00

29 lines
498 B
PHP

<?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();
}
}