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

coderathore's avatar

I have four type user So we want to create separate login for admin and staff and user and client

Hello,

I have a four type user but we want to create a separte type login for admin , user, client,staff. but i am using only one table for all .

Please Help me to solve htis problem.

0 likes
7 replies
coderathore's avatar

But i dont want to create more table and every login form is differnent.

In client login form only client can open no any one open . In user login form only user can open no any one open . In staff login form only staff can open no any one open . In admin login form only admin can open no any one open .

36864's avatar

In order for you to determine the user's type, they must first log in. You can't control access to login forms before the user is logged in. You can have different views and have a link to each one, but nothing's stopping a user from accessing the admin login page.

In the controller for each of your log in routes, you can check if the user that is trying to authenticate is the type of user you want to use that route, and redirect/return an error if not, but this all is really a lot of work to go through to avoid the easy way which is to have the logged in user be redirected to the corresponding type's home.

coderathore's avatar

Can you send link where see the seprate login functionlaity and implement into my project....Beacuse i dont want to create new table. And i have one table in databse Like users table.

So i am very dispointed to how create seprate login in larravel PLease help me to send the link .

1 like
coderathore's avatar

@pafait Thanks for send the link .but in this there are two table users and admin but i want work with the only one table user.

so please help me to solve the problem.

Please or to participate in this conversation.