Files
2026-06-11 11:46:12 -04:00

26 lines
489 B
PHP

<?php
namespace App\Services\Notifications;
use App\Models\UserNotification;
class NotificationReadService
{
public function markRead(int $userId, int $notificationId): bool
{
$row = UserNotification::query()
->where('user_id', $userId)
->where('notification_id', $notificationId)
->first();
if (! $row) {
return false;
}
$row->is_read = true;
$row->save();
return true;
}
}