entrust
entrust copied to clipboard
renamed 'can' method to 'permission' since it is in the laravel core
The 'can' method in the user trait is now in the core library, in order to use both functionalities, it is renamed to 'permission'.
For anyone else struggling with this, in your user model:
use EntrustUserTrait {
can as hasPermission;
}
@tripper54 Maybe it makes sense to use
use Illuminate\Foundation\Auth\Access\Authorizable;
// ...
class User extends Authenticatable
// ...
use Authorizable, EntrustUserTrait {
Authorizable::can insteadof EntrustUserTrait;
EntrustUserTrait::can as hasPermission;
}
because Authorizable::can
(standard Laravel method for App\User
) is not available in your version.
Or I'm wrong?
@sergiobelya , you're right, that's a better solution.
please solve this conflict , i have error for this
i use your solution but permisson not work
$this->middleware('permission:commnet-manager');
??
how i can middleware ?