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

Norbertho's avatar

Vue SPA with Laravel Authentication

Hi, I am in a learning phase in learning Vue js SPA with Laravel. I watching tutorials on YouTube and all the tutorials shows that they create a new Laravel project then the create a new Vue js project with Vue CLI. But I am a bit confused why they so that? Laravel comes with vue js if I run "composer require laravel/ui" and then "php artisan ui vue" so why the they do it separately? Is it not working if I install vue with laravel?

0 likes
5 replies
jeffreyvanrossum's avatar

When taking the SPA route, I guess it's more likely you would want to develop your front-end separately from your back-end entirely. In this case Vue being your front-end, and Laravel would be your back-end / API.

1 like
acoustic85's avatar

Hi there,

Basically you need to install Vue into the laravel environment and like Jeffrey said Vue will be your front end and laravel will be your backend but you need to access backend by API routes and the best solution for that for me was using axios.

1 like
Norbertho's avatar

Thanks @jeffreyvanrossum and @doncho85 for your replies. So basically it is adviced to install vue and laravel separately, but if i want i can develop them in the same project folder too. The main point here i need to use laravel api route as a connection between vue and laravel.

martinbean's avatar

@norbertho Vue is just a JavaScript framework. It doesn’t need to be “separate” from your Laravel repository. Use Mix, create your Vue components, and load it in a Blade view. There’s no need to overcomplicate things.

2 likes

Please or to participate in this conversation.