Download the PHP package modulate/artisan-interceptor without Composer
On this page you can find all versions of the php package modulate/artisan-interceptor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download modulate/artisan-interceptor
More information about modulate/artisan-interceptor
Files in modulate/artisan-interceptor
Package artisan-interceptor
Short Description Allows you to add options, listeners and handlers to artisan commands
License MIT
Informations about the package artisan-interceptor
Modulate Artisan Interceptor
An easy but elegant way to change global behaviours of Artisan commands
Features
- Add new global options to artisan e.g. --tenant=2 or --module=my-module
- Add handlers to be executed before and/or after an artisan command is run
- Add conditional handlers than only run when a specified option is given to a command
- Fluent builder for adding input options to artisan
Adding Global Options
Generally speaking there is currently no easy way to add new global options to the artisan command. Options like --env or --version come built in but artisan doesn't expose a way for you to add new ones out of the box. This is where artisan interceptor comes in.
The interceptor allows you to add new global options to artisan and add your own custom handlers detect and process those options. This is all done using the built in artisan events but gives you a clean and elegant way of adding and interacting with new options
Installation
You can install the package via composer:
Usage
Adding Global Options
Adding Listeners
Extending Interceptor
You have full control of what the interceptor for all callback types. You can even add your own custom handlers by implementing the handler contracts directly