Add artisan dev command#60412
Open
joetannenbaum wants to merge 27 commits into
Open
Conversation
nunomaduro
requested changes
Jun 5, 2026
Contributor
Author
|
Also, a subtle gotcha we should consider: commands are keyed by name, and if you don't provide a name it will be derived as described in the PR description. I think the chance of collision is low, making name required would avoid this altogether. Just wanted to collect the least amount of information up front. |
shaedrich
reviewed
Jun 5, 2026
Co-authored-by: Sebastian Hädrich <11225821+shaedrich@users.noreply.github.com>
Co-authored-by: Sebastian Hädrich <11225821+shaedrich@users.noreply.github.com>
…nto composer-dev-process
jackbayliss
reviewed
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new
php artisan devcommand that runs your development processes (server, queue worker, log tailing, Vite) concurrently usingconcurrently. The default behavior is effectively the same as the currentcomposer dev.Commands are registered via
DevCommandsand can be customized, filtered withonly/except, and color-coded.Includes automatic Node package manager detection (npm, yarn, pnpm, bun) and prevents vendor packages from registering dev commands.
The Pain Point
Adding commands to
composer devis tedious and error-prone. With this new convention, you can simply add the following to your service provider, and the new commands will be included in the mix:You can optionally provide a name for the process as the second argument; otherwise, the name will be the first segment before the first space.
If you'd like a specific color for the command:
Vendor Protection
DevCommandsexplicitly prohibits automatic command registration from thevendordirectory. That said, it does allow a package to provide a helper that can be called from userland code to register commands, for example:Reverb::registerDevCommands();I'd like more eyes on this part of the code, as it's the most sensitive area of the changes.
Bonus: Node Package Manager Helper
This PR also includes
NodePackageManager, which is probably overdue at this point. It auto-detects the package manager based on the lockfiles present, which allows a genericDevCommandlike the following to auto-resolve to the correct command for the project:For the scope of this PR, I kept the helper limited to the methods that were necessary for these changes, but they can be easily expanded in the future.