. */ namespace App\Policies; use App\Models\Track; use App\Models\User; class TrackPolicy { public function edit(User $user, Track $track) { return $user->id === $track->user_id || $user->hasRole('admin'); } public function delete(User $user, Track $track) { return $user->id === $track->user_id || $user->hasRole('admin'); } }