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

Shivamyadav's avatar

How to handle login in vue without real api .

I have created a noraml authentication system with Laravel and vue in same project for spa .. The main thing is I'm using normal web.php routes and returning the response json instead of going with Laravel auth Sanctum..

The question arrives how do I make sure that the user is login and has the permission like middleware to access the particular resources through vue and pinia..

1 like
1 reply
vincent15000's avatar

I have created a noraml authentication system with Laravel and vue in same project for spa

If you have the back and the front in the same project, you can effectively do without Sanctum, but to be sure, can you show your login code and route ?

Please or to participate in this conversation.