1

I enter npm run watch first and then then I can't enter php artisan serve. Is there a way I can use them in the same command?

Thanks

alex
  • 21
  • 5

2 Answers2

1

Open two terminals and enter npm run watch into one, and when that's ready run php artisan in the other terminal.

alex
  • 21
  • 5
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 06 '22 at 15:26
0

If this helps anyone, npm run hot works correctly with Laravel 8 and Vue 2. I'm using built-in Vue scaffolding of Laravel UI (and not a separate Vue CLI project).

Just use php artisan serve to serve your Laravel application and then open a new terminal window and run npm run hot. Now the browser output will update automatically when you make changes to your Vue components.

Make sure your webpack.mix.js contains the .vue() call in its chain.

dotNET
  • 33,414
  • 24
  • 162
  • 251