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
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
 
    
    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
 
    
    Yes. There is a creative way You should define a variable in your command line İf you're using linux run this command:
export part="php $PWD/artisan serve"
Note:part is variable name. Name it whatever you want (part stands for php artisan)
Note:by running this command the variable will accessible just in that CMD window. That means this way is a temporary way and if you want to access it all the time you need to add this command to your .bash or .profile file
