Closed 77120bd closed 1 month ago
The default definition for the view policy method in laravel is the same as the stub we are using in shield. so if you want to change the definition that's dev land but the default will stay the same. thanks. fyi... when you have some custom code in the policies the generate command has a flag to not override them.
I got an error when using AnyResource::can('view')
Too few arguments to function App\Policies\AnyPolicy::view(), 1 passed in /var/www/html/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php on line 811 and exactly 2 expected
It needs a second parameter which isn't used in the methods.
public function view(User $user, Model $model): bool { return $user->can('view_model'); }
I removed the second parameter from the stub files to fix the issue.