phpnode.jslaravelnpmvite

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


Solution

  • 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