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

shashi_verma's avatar

vue.js and Laravel - How do we run vue-laravel project on localhost without using "php artisan serve" ?

I Have a Project in Vuejs and Laravel,and i want to run that project without "php artisan serve" like my url should be "localhost/myproject" but it doesn't work and when i run that project with "Php artisan serve" command it runs, but here is also a problem, is that when i reload the page it shows an error then i have to remove all the path like this,, from this "127.0.0.1:8000/default/index" to this "127.0.0.1:8000" and then reload , and then it works,Help me , Thanks

0 likes
11 replies
Aminul_Chowdhury's avatar

I am facing same problem on Windows system. when run the project with "localhost/myproject/public/index.php", My web route path not found in .vue file.

Anybody can help me??

fylzero's avatar

I see a lot of people asking about using localhost claiming to have to reset all their paths. You guys should all be using relative paths in your projects or using environment variables to easily change paths. It gives your project better mobility across servers and is just a good idea in general. Solve that problem and the other one goes away.

Try updating your .env file?

24 likes
fylzero's avatar

@aminul_chowdhury Open your .env file in the root of your project. If you haven't created one copy the .env.example to .env ...you'll see http://localhost at the top of the file. Change that to what you need it to be.

Deeper than that... Google using relative paths in PHP development.

24 likes
saadbutt's avatar

what , if we want run this on localhost ?

Please or to participate in this conversation.