<?php namespace App\Policies; use App\Models\{User,LeaveRequest}; class LeaveRequestPolicy {public function before(User $u):?bool{return $u->hasRole('founder')?true:null;} public function viewAny(User $u):bool{return $u->hasPermission('attendance.review');} public function view(User $u,LeaveRequest $m):bool{return $u->hasPermission('attendance.review')||($m->user_id??null)===$u->id||($m->claimant_user_id??null)===$u->id;} public function create(User $u):bool{return $u->hasPermission('attendance.review');} public function update(User $u,LeaveRequest $m):bool{return $u->hasPermission('attendance.review');} public function delete(User $u,LeaveRequest $m):bool{return $u->hasPermission('attendance.review');} }