When using policies in Laravel 5.7 I get the above mentioned error. (Debugbar v3.2)
It also happens on a fresh copy of Laravel.
It's thrown in Illuminate\Auth\Access\Gate.php @ callbackAllowsGuests
Parameter passed to the ReflectionFunction constructor:
array:2 [â–¼
0 => GateCollector
1 => "addCheck"
]
It happens only when there is no authenticated user.
It occurs when calling the authorize method in the controller:
$this->authorize('action', $model);
And when using the @can blade directive
@can('view', $model)
Setting gate collector to false in debugbar's config seems to fix the issue.
Same issue, posted on Laracasts and found afterwards it was coming from Debugbar
For more information : https://laracasts.com/discuss/channels/laravel/laravel-57-policy-issue
is there way to fix this? because gate collection is much helpful when finding a failed permission
Same issue. I'd never known If i didn't find this posts
Same issue. This posts are very helpful
Setting gate collector to false in debugbar's config seems to fix the issue.
You can uninstall Debugbar, it will fix the issue too
Same issue for me..
Most helpful comment
Setting gate collector to false in debugbar's config seems to fix the issue.