fokosun/artisan-chain-commands

Run multiple artisan commands all at once with a very short, simple and sweet syntax

v1.0.1 2023-11-14 03:40 UTC

This package is auto-updated.

Last update: 2024-12-14 05:50:54 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.

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