ollieread / multiauth

Laravel multi auth
441 stars 109 forks source link

intregreting with zizaco entrust permission #50

Closed saurovh closed 10 years ago

saurovh commented 10 years ago

hi, thanks for you library. i am using laravel default auth and entrust permission together. but some how i needed multiauth now so i implemented it. its works. but before i was checking permission like this .. Entrust::->can(); .. not how should i implement it ?

ollieread commented 10 years ago

I've not used Entrust before but I've just taken a quick look at it. Such methods as Entrust::can('manage_posts') will likely not work, but you can do something like Auth::usertype()->can('manage_posts').

Hope that helps.

iwalid commented 10 years ago

Hi, Unfortunately neither can() or hasRole() work, tried that too and I get this error:

call_user_func_array() expects parameter 1 to be a valid callback, class 'Ollieread\Multiauth\Guard' does not have a method 'hasRole'

iwalid commented 10 years ago

nevermind, Auth::user()->get()->hasRole('Admin') works, thanks for your work !

faradoxuz commented 7 years ago

Auth::user()->get()->hasRole('Admin') not working. Call to undefined method Illuminate\Auth\GenericUser::hasRole()