CRM/backend/app/Policies/NotificationPolicy.php

25 خطوط
520 B
PHP

<?php
namespace App\Policies;
use App\Models\Notification;
use App\Models\User;
class NotificationPolicy
{
public function view(User $user, Notification $notification): bool
{
return $notification->user_id === $user->id;
}
public function update(User $user, Notification $notification): bool
{
return $this->view($user, $notification);
}
public function delete(User $user, Notification $notification): bool
{
return $this->view($user, $notification);
}
}