how setting User authorizeRoles() if i want separate dashboard for employee and manager?
Arief Budi Prasetyo
84

In login controller you can do like this.

public function authenticated(Request $request)
 {
 // Logic that determines where to send the user
 if($request->user()->hasRole(‘user’)){
 return redirect(‘/user/home’);
 }
 if($request->user()->hasRole(‘admin’)){
 return redirect(‘/admin/home’);
 }
 }

Like what you read? Give Vivek Kumar a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.