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

enadabuzaid's avatar

I want to make login and register from more one table

Hello everyone I want to make login from more one tables in database for example I have doctors , students and admins table can advice me what should I do ?

I'm trying all tutorial but no one work with me :(

0 likes
4 replies
Snapey's avatar

Please don't do this. You will regret it later.

Users are users. Their role might be different, and you can decide what they can do with authorisation once you have authenticated them.

If you can, authenticate all users using the same method.

RayC's avatar

Why not use roles for each? Have a role for each: doctor, student, and admin. Use the users table to provide login details and the other tables as their profile.

You can link the profile tables by adding user_id to them and adding the relationship to the models. You can use a package like spatie/laravel-permissions to manage the roles and permissions:

https://spatie.be/docs/laravel-permission/v5/introduction

Please or to participate in this conversation.