Hello,
in the __construct method of my Controller I added a line to check the ability ofr the user to access the Controller. I'm using the Authorization features of Laravel (https://laravel.com/docs/5.2/authorization) with the Gate facade, example :
function __construct()
{
if (Gate::denies('access-users')) {
abort(403);
}
}
Everything works fine except with the php artisan route:list which prints the following error :
$ php artisan route:list
[Symfony\Component\HttpKernel\Exception\HttpException]
Is other a way to bypass Authorization when using Artisan ?
thanks
// check if request not from cli
if ('cli' != php_sapi_name()) {
$this->authorize('is_admin');
}
from a console is 'cli'...
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community