Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bobbiedigital's avatar

I know this is a while ago, but would you be able to use a singular table for authentication with a column as multi-level authentication?

That is, a column with say, 0=guest, 1=admin, 2=user, 3=somethign else and then in the view use

@if( Auth::user->role > 1) print @endif

Something similar? Is it even possible to perform a calculation in the @if?

I understand it mightn't be pure "laravel" but it will definitely cut down db redundancy and code.

clayzar's avatar

To separate the sessions, point two different domains or subdomains at your Laravel app, because sessions are distinct for a domain (or subdomain). For instance, users.myapp.com and staff.myapp.com could both point to your Laravel app and you would use guards and domain-specific routing in your route file(s). With this setup, when you logout of users.myapp.com you will maintain your logged-in session at staff.myapp.com

Previous

Please or to participate in this conversation.