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

traceyjas's avatar

How can I use fortify for both API and web

I need to create an application. I need an admin portion as well an api that would be used by customers. I plan to use fortify and sanctum for authentication. I am unclear as how to get fortify to work with both web and api authentication.

Any suggestions would be really helpful

0 likes
3 replies
traceyjas's avatar

So you are saying for the API use passport and then i'll be able to use fortify for the web portion

jlrdw's avatar

Sanctum or passport can be used, I just suggest passport. But it's only a suggestion if you do not have an SPA. But if you do have an SPA then look at using Sanctum.

But the session portion you mentioned, any of the session based techniques would work including Fortify.

View those videos also, they explain a lot.

1 like

Please or to participate in this conversation.