DEV Community 👩‍💻👨‍💻

AjayMalhotra
AjayMalhotra

Posted on

Laravel - redirect user based on usertype

https://therichpost.com/laravel-7-how-to-redirect-authenticated-users-based-on-user-type/

Thank you

Top comments (1)

Collapse
 
auniik profile image
Auniik Datta
protected function authenticated(Request $request)
{
      return redirect(
          [
              'admin'  => '/admin/dashboard/',
              'superadmin' => '/superadmin/dashboard/'
          ][ auth()->user()->userType ]
    );
}

How's that ?

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git