In that case, create a separate table for roles and permissions (spatie/laravel-permission can help). Then, create the permissions and roles and assign permissions to roles. I would recommend as best practice to rely mainly on permissions in your applications as differents roles may have common permissions. Now, when a user is created assign him a role, and rely on this first role for redirect ($user->roles()->id). You can have a menu where he can switch to another dashboard based on his roles. Hope it helps.
A Software Developer who is geared towards building high-performing and innovative products following best practices. I help you become a great Backend Engineer @ https://masteringbackend.com
How if the user have multiple account with different roles,but with the same credentials ? I assumed this nice guide not covered it yet :)
In that case, create a separate table for roles and permissions (spatie/laravel-permission can help). Then, create the permissions and roles and assign permissions to roles. I would recommend as best practice to rely mainly on permissions in your applications as differents roles may have common permissions. Now, when a user is created assign him a role, and rely on this first role for redirect ($user->roles()->id). You can have a menu where he can switch to another dashboard based on his roles. Hope it helps.
Yes the article didn't cover that. But I will suggest you use OTP to implement such scenerios.