paschaldev / laravauth

Laravel authentication with a twist
MIT License
16 stars 7 forks source link

Redirect Issue #5

Open MonMohon opened 5 years ago

MonMohon commented 5 years ago

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'); } }