DEV Community

Discussion on: Multiple role-based authentication in Laravel

Collapse
 
kaperskyguru profile image
Solomon Eseme

I'm Having errors after implementing this.
I logged in as academy then try to visit the admin dashboard by typing the route to it in the browser and i got this -> "Call to undefined method Illuminate\Auth\AuthManager::user()"

Collapse
 
computermaverick profile image
⚓Timmy Iwoni ⚓

In Martin's implementation there's a typo of the parenthesis when calling the Auth facade... So instead of Auth()::user()->role, it should be Auth::user()->role

Thread Thread
 
kaperskyguru profile image
Solomon Eseme

Oh that's true.. I will fix that..

Collapse
 
martin_betz profile image
Martin Betz

I'll replicate it soon, probably I just have a typo somewhere.

Thread Thread
 
kaperskyguru profile image
Solomon Eseme

Sure. I will be expecting.