Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename method "can", because of this throw Exception of collision traits. #371

Open
serovvitaly opened this issue Sep 2, 2015 · 13 comments

Comments

@serovvitaly
Copy link

Rename method: \Zizaco\Entrust\Traits\EntrustUserTrait::can.
In new version laravel, in User model added new trait \Illuminate\Foundation\Auth\Access\Authorizable, that has method "can". Because of this throw Exception of collision traits.

@mstralka
Copy link

mstralka commented Sep 3, 2015

It started with Laravel 5.1.11 and the authorization support.

@bobo52310
Copy link

I had the same trouble... finally fixed it by using insteadof keyword.
PHP Trait Conflict Resolution

use Authenticatable, Authorizable, CanResetPassword,
        EntrustUserTrait {
            EntrustUserTrait::can insteadof Authorizable;
        }

@vahobrsti
Copy link

@bobo52310
Thanks, it solved my problem as well. It really drove me crazy 👍

@qazihamayun
Copy link

@bobo52310 Thanks Man. It solved the problem

@acacha
Copy link

acacha commented Sep 14, 2015

Ok but taking into account Entrust is a Laravel Package it seems to me a good idea to change method name can in Entrust

@iamandrewluca
Copy link

Same problem here!
Does Laravel Authorization offers what Entrust do?
I would switch from Entrust in favor for native Laravel authorization if so.
Thanks.

@chrisburton
Copy link

I use Roman Bican's roles/permissions package. Over there I have suggested renaming can to may as a solution.

@mrgrt
Copy link

mrgrt commented Sep 20, 2015

Thanks @bobo52310. Looks like a good idea @ChristopherBurton to rename to may. Noticed #379 mentions the same issue.

@331164885
Copy link

@bobo52310 万分感谢,这个问题困惑了我好几天,现在终于解决了

@thamerbelfkihthamer
Copy link

@bobo52310
Thanks, it solved my problem as well. It really drove me crazy

@jidesakin
Copy link

Thanks @bobo52310 It worked but Auth::logout stopped working. Any ideas on how to fix that?

@gildniy
Copy link

gildniy commented Dec 16, 2015

@bobo52310, leme say thanks too, coz this did the trick for!

@danielgelling
Copy link

Thanks! That really helped me. Maybe an idea to include in the docs @Zizaco?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests