entrust
entrust copied to clipboard
EntrustUserTrait conflicts with Authorizable
As I debugged, Zizaco\Entrust\Traits\EntrustUserTrait conflicts with Illuminate\Foundation\Auth\Access\Authorizable. Both have can() method.
The fix is to rename can method in EntrustUserTrait to hasPermission or resolve the conflict inside the User class like so:
class User extends Model implements Authentic...
{
use Authenticatable, Authorizable, CanResetPassword, EntrustUserTrait {
Authorizable::can insteadof EntrustUserTrait;
EntrustUserTrait::can as hasPermission;
}
...
}
Thanks for the heads up! Hope this gets accounted for in the next update
Hello,
this is still a problem, and using insteadof and as statement is useless because can function in entrust is recursive when passing an array of permissions, so the call end up in laravel permission system...