Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel artisan serve and npm run dev single command

Is there a way to run terminal commands simultaneously

Like php artisan serve

And npm run dev (for laravel vite)

Run it in a comment or terminal with a shortcut

like image 214
Danial Qsk Avatar asked Dec 05 '25 17:12

Danial Qsk


1 Answers

There is another solution using concurrently npm package

first install concurrently (you can install it globally)

npm i concurrently -g

then run

concurrently "php artisan serve" "npm run dev"

or you can use it as package.json script

1 : update you package json like this

    "scripts": {
        "dev": "vite",
        "build": "vite build ",
        "start": "concurrently  \"php artisan config:cache\" \"php artisan serve\" \"npm run dev \"  "
    },

2 : in terminal run npm start

like image 107
Danial Qsk Avatar answered Dec 08 '25 06:12

Danial Qsk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!