decide() returns null when the adapter doesn’t own the ability (Laravel’s local Gates/policies then
decide), otherwise IamClient::check($user, $ability, $context)->granted().
Resource from gate arguments
The first element of $arguments is used as the resourceonly if it is a non-empty string:
$user->can('warehouse:stock.adjust', 'wh_milan'); // resource = 'wh_milan'$user->can('billing:invoices.update', $invoice); // model → NO resource (global)$user->can('billing:invoices.update', (string) $invoice->id); // resource = id
flowchart TD
A["decide(user, ability, arguments)"] --> O{"owns(ability)?"}
O -->|no| N["return null (local gate decides)"]
O -->|yes| C["context = first arg is non-empty string ? ['resource'=>arg] : []"]
C --> G["IamClient::check(user, ability, context)->granted()"]
G --> R["true = allow · false = deny"]