Check user type in laravel

2024-03-04 04:55:35 Sharad Jaiswal Laravel

Add a type field in your auth table, once you added it save user type and check user type in Laravel using below code

\Auth::user()->type // Returns logged in user type

Redirect user on basis of user type in Laravel


return Redirect::to('/dashboard/contributer');


return Redirect::to('/dashboard/visitor');


This post is submitted by one of our members. You may submit a new post here.

Related Tricks