-4

I'm trying to do this thing where if the user logging is an admin then Laravel needs to send them to the admin route and if the user is a customer then it needs to send them to the customer route.

I'm not sure how to go about doing this.

Any help would be much appreciated.

OMR
  • 11,736
  • 5
  • 20
  • 35

1 Answers1

0

users table add new column role different role admin user and customer and login controller check role and return view with different route

    $user= Auth::user()->role;
      if ($user->admin){
       return redirect()->route('')
        }else if($user->user){
       return redirect()->route('')
       }else{
       return redirect()->route('')
         }
OMR
  • 11,736
  • 5
  • 20
  • 35