When I've implemented this (https://mattstauffer.co/blog/acl-access-control-list-authorization-in-laravel-5-1) authorization laravel 5.1 tutorial, I've found the usage of this
if (Gate::allows('create-contact')) {
redirect('hooray');
}
And then the framework shows me this error
Call to undefined method Illuminate\Auth\Access\Gate::allow()
Everything is OK with the dependencies, so that's not the problem, then I found that laravel started to implement this method since version 5.1.11 in this topic at laravel's docs for authorization (laraveldocs/5.1/authorization) So laravel team is saying in their documentation page that this authorization feature is available since version 5.1.11.
I was getting the same error, so I went to the laravel/framework repository on github (github/laravel/framework/) and check from version 5.1.11 to 5.1.31 and found that method doesn't exist in the source code.
That gate method is available since version 5.2
You can check both of them here for v5.1 (github/laravel/framework/blob/v5.1.31/src/Illuminate/Contracts/Auth/Access/Gate.php) and for v5.2 (github/laravel/framework/blob/v5.2.0/src/Illuminate/Contracts/Auth/Access/Gate.php)
So I wanted to share this knowledge with you, but if you find a solution, without upgrading the version of the framework, I would be glad to know.
Thanks!
Illuminate\Authpackagist.org/packages/illuminate/auth#v5.2.0 ? - haakym