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

devondahon's avatar

Signin users and admins on the same Laravel API

I have my Laravel API managing users and admin tables, a Nuxt frontend for users and a Nuxt backoffice for admins, the frontend website is under a different domain name.

Is it possible to signin both users and admins with Laravel Passport (oauth type, not password grant which is deprecated) ? If not, what would be a good alternative (maybe a mix between Passport and something else) ?

0 likes
4 replies
Ben Taylor's avatar

If it was me, I'd keep it simple and not have an admins table. Just use users with an admin flag on it, or something like that.

1 like
martinbean's avatar

@devondahon You would need to create different clients. Each client can then be associated with a different user guard.

devondahon's avatar

@martinbean Using diffent clients and associate guard/provider works with the deprecated password grant (which is what I'm currently using: a guard/provider for each website), but it does not work with oauth which needs a user session. I will probably have to merge my users tables and add a role column to switch from password grant to oauth (with @nuxt/sidebase on my websites).

Please or to participate in this conversation.