for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Policies;
use App\Models\User;
class UserPolicy
{
public function destroy(User $currentUser, User $userToDestroy): bool
return $currentUser->is_admin && $currentUser->id !== $userToDestroy->id;
}