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

aicxe's avatar
Level 1

Roles vs. Multi-auth in Laravel 5.5

Hello, I am writing an appointment booking application in Laravel 5.5. I have two kinds of users: Patients and Practitioners that will each be assigned to an Appointment (one Practitioner and one Patient per Appointment).

I want to have one login form for both patients and practitioners, with a hidden URL /admin that redirects to the admin login page (I'm looking at Voyager for that and so far it looks nice - but I'm new and this might add unneeded complexity to my app).

I have been reading too many resources that I don't know where to start. I am looking at two approaches - multi-auth for two different models (Patient and Practitioner) or a single auth against a polymorphic User model with a setting to show different views for different roles.

One one hand, multi-auth looks needlessly complicated for only two kinds of Users. On the other hand for single-auth, I imagine I'd need to declare User to polymorph into either Patient and Practitioner - another complication.

Sooner down the line, I'd like to integrate CAS into the app, but that's a problem for another day. What approach would be better to implement? I'd like to narrow my options because right now I don't know how to approach this problem.

0 likes
2 replies
Borisu's avatar

Are the properties on the Patient and Practitioner very different? If so you'll only benefit from two separate models and thus a multi-auth system is a nice way to go about it.

If the two models are basically the same, then you should consider just using a model User with a type prop = patient or practitioner, or some kind of role based system. Then you avoid polymorphism and multi-auth altogether.

aicxe's avatar
Level 1

I'll check into props and roles - I think that might be the simpler approach. Thanks.

Please or to participate in this conversation.