New composer run dev command in Laravel

New composer run dev command in Laravel

Posted by

kamlesh paul

on

Dec 11, 2024

1 min read

Last updated on : Dec 11, 2024

134 views

Laravel has recently introduced the composer run dev command to the framework, allowing you to run multiple commands simultaneously:

  • php artisan serve
  • php artisan queue:listen --tries=1
  • php artisan pail
  • npm run dev

All of these commands can now be executed in one go, with color-coded output in the terminal using the concurrently package. This feature provides a convenient way to start the application along with all the essential services you need.

The pull request also includes Tailwind CSS out of the box, enabling you to start using Tailwind immediately without the need to install any starter kit. This is particularly useful for developers who want to experiment or build projects from scratch.

For users of older Laravel versions who wish to utilize this new feature, simply add the following to your composer.json in the scripts section:

composer.json
"dev": [
    "Composer\\Config::disableProcessTimeout",
    "npx concurrently -k -c \"#93c5fd,#c4b5fd,#d4d4d8,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail\" \"npm run dev\" --names=server,queue,logs,vite"
]

This configuration will work the same way as the new composer run dev command introduced in the pull request.

Get updates directly to your inbox.

Join 500+ developers getting updates on Laravel & Next.js tips. No spam,
unsubscribe anytime.


Share this article:

134 views