You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All references to my policies using Gate::authorize() give a 'not found' error message. The error message seems to indicate that the extension is looking for a policy with a name matching the method I'm trying to call on it.
E.g. this code in a controller:
Gate::authorize('update', $program);
Results in a lint (squiggly underline, no link/reference) with the message "Policy [update] not found."
My setup is completely vanilla in regards to auth/policies/controllers—Program is a regular model, ProgramPolicy exists in the default location and has an update method, etc.
I can reproduce this in a new Laravel 11 app too after running php artisan make:policy UserPolicy --model=User and php artisan make:controller UserController --model=User and adding Gate::authorize('create', User::class);.
Extension Version
0.1.18
PHP Binary
Valet
Operating System
macOS
What happened?
All references to my policies using
Gate::authorize()
give a 'not found' error message. The error message seems to indicate that the extension is looking for a policy with a name matching the method I'm trying to call on it.E.g. this code in a controller:
Results in a lint (squiggly underline, no link/reference) with the message "Policy [update] not found."
My setup is completely vanilla in regards to auth/policies/controllers—
Program
is a regular model,ProgramPolicy
exists in the default location and has anupdate
method, etc.I can reproduce this in a new Laravel 11 app too after running
php artisan make:policy UserPolicy --model=User
andphp artisan make:controller UserController --model=User
and addingGate::authorize('create', User::class);
.Mimimal Code Sample
The text was updated successfully, but these errors were encountered: