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

kevariable's avatar

Possible to make multiple guard with Fortify without Jetstream?

Hello everyone,

I want to create a school website and there are admins, teachers and students if there are references to determine what steps to create a login

I also use spatie/laravel-permission.

0 likes
11 replies
Snapey's avatar

I would not use separate guards for this.

admins, teachers and students are all users - treat them as such. Control what they can do through authorization.

With your current plan, what if a teacher is also an admin?

1 like
kevariable's avatar

Thank for your response ;)

Is it the same to create multiple guards in laravel 7 to be implemented in laravel 8? thanks

bobbybouwmann's avatar
Level 88

Yes, one table is the better approach for the authentication system. You should use a role-based authorization system for different users.

And yes, multiple guards work the same in Laravel 8 as in Laravel 7. As discussed above, you don't need that ;)

2 likes
kevariable's avatar

sir how to handle different needed for example

teacher has NIK, Name and student has NIM, Name

for approach one table?

mounir's avatar

Can you please show me how you solved, Thank you.

Please or to participate in this conversation.