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

Hamza1024's avatar

Best way to use laravel with Vue js?

I have some experience with Laravel and Recently I have learned Vue js. Now At this stage, I am confused on What is the best way to use Laravel with Vue js. Some people recommend using Intersia js. Some have set up vue js inside Laravel and use it without inertia js. Some people advise to setup both projects separately like creating Laravel in a separate folder called Backend and Vue js in a separate folder called Front end then using that. So I am confused a lot about what is the best way and which one is preferred in the industry. Thanks

0 likes
5 replies
puklipo's avatar

The use of Vue in laravel/ui is useful.
laravel/ui should not be used in new projects, but you can refer to only how to introduce Vue.
https://github.com/laravel/ui/tree/4.x/src/Presets/vue-stubs

In the days of Laravel 5.x, this method of mixing a little bit of Vue into Blade was the standard.
This is the best for beginners.

Inertia and "separate projects" are difficult for beginners, so they should be avoided.

JussiMannisto's avatar

@puklipo

Inertia and "separate projects" are difficult for beginners, so they should be avoided.

Hard disagree. Inertia makes it way easier to work with Vue. It's much easier than using API endpoints and separate routing.

@hamza1024 I recommend InertiaJS. The easiest way to get started is with a starter kit like Breeze. Here's how you install and run it in a fresh project:

composer require laravel/breeze --dev
php artisan breeze:install
php artisan migrate
npm install
npm run dev

You can check how the controllers return Inertia pages and pass data to the front-end. Then read the Inertia docs on how to use routes and forms on the front-end. Then you'll know 95% of what you need to know about Inertia.

1 like
experimentor's avatar

I think the best way to use vue with laravel is to use it with Inertia JS. Given that you just learnt Vue, this is the best option. Advantages with Inertia:

  • Laravel handles the routing of the app. No need to configure separate router in Vue
  • Data passed as components to vue. No need for sepcial gimmicks to pass data from php to vue.
  • Comes with Server side rendering (SSR) making your app seo friendly and super fast.

Disadvantages with other methods you mentioned:

  • needs more work with configuring routers, may need api authentication with sanctum. Not sure if it can handle SSR

Give Inertia.js a try. You will love it. Hope this helps.

2 likes
Hamza1024's avatar

@vishy@serialxtech.com Thanks @vishy@serialxtech.com for this brief Answer. Someone from the industry guided me to go with the Separate Folder Method like Creating a frontend folder and Creating a Backend Folder and Doing the work. This will help me to understand more and I think it's hard for beginners. By the way, I have 2+ years of experience with Laravel. Let's see I will give it a try to use inertia JS. In the end, the Client needs a working product. Mostly 90% never go inside the technical details of the product. They only want a working version. That's it. So I think First I will start with inertia JS and then go to these separate Folder techniques. What you do think about that?

Please or to participate in this conversation.