paschaldev / laravauth

Laravel authentication with a twist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redirect Issue

MonMohon opened this issue · comments

First of all thanks for very nice and valuable package.

i've a protected function redirect based on user role.
Ref: https://www.5balloons.info/user-role-based-authentication-and-access-control-in-laravel/

please tell me how do i implement in your package

protected function authenticated($request, $user)
{
if($user->hasRole('ROLE_OWNER')) {
return redirect('/owner');
} elseif ($user->hasRole('ROLE_TRAINER')) {
return redirect('trainer');
} else {
return redirect('/home');
}
}