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

BMS51's avatar
Level 1

Laravel fortify Auth and Sanctum combination possible?

Hello,

I've been reading multiple articles about Laravel Fortify and Sanctum. The idea is to create an applications that has a backend for administrators and multiple frontends for endusers ( VUEJS PWA, Thrid-party connection, mobile-app, ...).

The frontend users should be able to log in over the API (stateless) and the administrators log in on the backend system (web authentication). I've been looking at different solutions and examples but 90% of the focus on one of two never on both.

I was wondering if it is possible to have endusers log in over API using Sanctum and Admins over the web using default fortify authentication? If you would happen to have some documentation, video's about this subject that can be helpful it would be greatly appreciated.

Thank you in advance for your answer.

Best regards, Bart

0 likes
4 replies
jlrdw's avatar

Yes, for an admin to login, you can use regular authentication (fortify and web routes), this would be separate for an end user using the api (api routes) which would be token based.

1 like
BMS51's avatar
Level 1

@jlrdw Thank you for your reply. This takes away a good amount of doubt 🙂.

Some articles and blog posts contain some contradicting information. And other use third-party solutions that rewrite the base architecture which is just a bit over the top.

Kind regards, Bart

samjamzee's avatar

I know it should be possible...But Then How do you manage Authentication views(web) (login/register/reset_password) and JSON based APIs in Same time?

I mean how you manage, Fortify Serveiceprovider 'views property true/false.. I have a bit issue with this currently..

martinbean's avatar

@samjamzee Create your own thread if you have a question. Don’t bump a 5 month old thread to tag it on the end of.

Please or to participate in this conversation.