fokosun / artisan-chain-commands
Run multiple artisan commands all at once with a very short, simple and sweet syntax
Requires
- php: ^7.2.5|^8.0
- ext-json: *
- illuminate/console: ^6.0|^7.0|^8.0|^9.0|^10.0
- illuminate/contracts: ^6.0|^7.0|^8.0|^9.0|^10.0
- illuminate/support: ^6.0|^7.0|^8.0|^9.0|^10.0
- psy/psysh: ^0.10.4|^0.11.1
- symfony/var-dumper: ^4.3.4|^5.0|^6.0
Requires (Dev)
- mockery/mockery: ~1.3.3|^1.4.2
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^8.5.8|^9.3.3
Suggests
- illuminate/database: The Illuminate Database package (^6.0|^7.0|^8.0|^9.0|^10.0).
This package is auto-updated.
Last update: 2025-03-14 06:33:09 UTC
README
Chain Commands Artisan Command
This package helps to chain multiple artisan commands using a simple, easy to understand syntax.
Example
php artisan chain-commands "make:controller TestController,make:event TestEvent"
This will run the make:controller and make:event artisan commands consecutively and displays the output in a table.
How to install
Run the following artisan command in the root of your Laravel project.
composer require fokosun/artisan-chain-commands
Lastly, add Artisan Chain Commands to the list of providers in config/app
under providers:
'providers' => ServiceProvider::defaultProviders()->merge([
...
\Fokosun\ArtisanChainCommands\Providers\ArtisanChainCommandsProvider::class,
...
])->toArray(),
How to use
You can chain multiple artisan commands with ease but there are a few commands that are not supported. See list below.
Ignored Command | Description |
---|---|
chain-commands | Not allowed |
db | This opens a REPL (Read, Evaluate, Print and Loop) environment.\nYou should not run this command with chain commands. |
docs | This opens the Laravel documentation page in a browser window.\nYou should not run this command with chain commands. |
docs 1 | This opens the Laravel documentation page in a browser window.\nYou should not run this command with chain commands. |
docs 2 | This opens the Laravel documentation page in a browser window.\nYou should not run this command with chain commands. |
docs -- search query | This opens the Laravel documentation page in a browser window.\nYou should not run this command with chain commands.. |
help | Displays help for a command.\nYou should not run this command with chain commands.. |
serve | Not allowed. |
test | Not allowed. |
tinker | This opens a REPL (Read, Evaluate, Print and Loop) environment.\nYou should not run this command with chain commands.. |
vendor:publish | This is an interactive command.\nYou should not run this command with chain commands.. |
schedule:work | Starts the schedule worker.\nYou should not run this command with chain commands. |
queue:work | Starts processing jobs on the queue as a daemon.\nYou should not run this command with chain commands. |
queue:restart | Restarts queue worker daemons after their current job.\nYou should not run this command with chain commands. |
queue:listen | Listens to a given queue.\nYou should not run this command with chain commands. |
Artisan chain command will ignore these commands for the reasons outlined in the table above.
Shorthand commands
Artisan chain commands also ship with a few shorthand commands which are essentially a chain of commonly used commands to aid development. An example are the 'config:clear', 'cache:clear', 'view:clear'
commands combination. These can be run with just one single shorthand command. See list below:
'clear:ccv' => ['config:clear', 'cache:clear', 'view:clear'],
'clear:*' => ['config:clear', 'cache:clear', 'view:clear','event:clear', 'optimize:clear', 'queue:clear'],
'db:rms' => ['migrate:refresh', 'migrate', 'db:seed'],
Contributing
This is opensource and contributions are highly welcome.
License
MIT