© 2026 Hedgehog Software, LLC
can
public static function can(string $action, ?Model $record = null): bool { if (static::shouldIgnorePolicies()) { return true; } $policy = Gate::getPolicyFor($model = static::getModel()); $user = Filament::auth()->user(); if ($policy === null) { return true; } if (! method_exists($policy, $action)) { return true; } return Gate::forUser($user)->check($action, $record ?? $model); }
$policy
$action
return $policy->$action($user, $record ?? $model)
Gate::forUser($user)->check($action, $record ?? $model)