<?php
 namespace App\Policies; use App\Models\Admin; use App\Models\Ticket; use Illuminate\Auth\Access\HandlesAuthorization; class TicketPolicy { use HandlesAuthorization; public function viewAny(Admin $admin): bool { return $admin->hasPermissionTo('view tickets'); } public function view(Admin $admin, Ticket $ticket): bool { return $admin->hasPermissionTo('view tickets') && $ticket->isAccessibleBy($admin); } public function create(Admin $admin): bool { return $admin->hasPermissionTo('create tickets'); } public function update(Admin $admin, Ticket $ticket): bool { return $admin->hasPermissionTo('update tickets') && $ticket->isAccessibleBy($admin); } public function updateAny(Admin $admin): bool { return $admin->hasPermissionTo('update tickets'); } public function delete(Admin $admin, Ticket $ticket): bool { return $admin->hasPermissionTo('delete tickets') && $ticket->isAccessibleBy($admin); } public function deleteAny(Admin $admin): bool { return $admin->hasPermissionTo('delete tickets'); } public function reply(Admin $admin, Ticket $ticket): bool { return $admin->hasPermissionTo('reply tickets') && $ticket->isAccessibleBy($admin); } public function replyAny(Admin $admin): bool { return $admin->hasPermissionTo('reply tickets'); } public function assign(Admin $admin, Ticket $ticket): bool { return $admin->hasPermissionTo('update tickets') && $ticket->isAccessibleBy($admin); } } 