[Vuejs]-Laravel authentication or mix of Laravel and vuejs authentication

0👍

✅

If you use Laravel Mix, simply have one blade template that hosts your application (it’s already set in Laravel). However, if you’re using Laravel for API and a separate project for the front-end SPA, use Passport. Here’s one of the ways to do it.

If you are using Laravel Mix, the CSRF token is already in a meta tag and is being added to Axios. All you need to do is make on blade template show your app.

You can also have separate blade views for login / registration etc and show SPA when logged in. But that’s not really the best practice. Since I’ve figured out how to use Passport, I’ve always gone the separate vue project route.

Leave a comment