davidpeach / laravel-base-command
Requires
- php: ^8
Requires (Dev)
- orchestra/testbench: ^6.21
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-01-24 22:22:19 UTC
README
A little package to help create an automated flow in a Laravel project.
Let's say you or your company build Laravel sites / apps regularly. And let's say that there are a bunch of steps you go through each and every time you start a new project.
Wouldn't it be nice if you could automate that whole process?
Well that is exactly what Laravel Base Command tries to help you with.
By extending this package with your own, and with minimal setup, you can get a working setup flow.
Quick Start
Installation
composer require davidpeach/laravel-base-command
Usage
Required files in your child package
As Laravel Base Command attempts to do most of the heavy lifting for you, you only really need to create your Step
classes -- one for each step that you wish to perform.
- A
ServiceProvider
class that extendsBaseCommandServiceProvider
- A set of
Step
classes in your package's/src/Steps
folder. A step class must extend eitherStepAlways
,StepBinary
orStepChoice
.
Process
- Extend the base command service provider with your own.
- Add your command class that extends BaseCommand and add it to your service provider.
- Create your command classes.
- Add a list of your command classes in your command class that extends BaseCommand.
- Run your setup command.
When extending laravel-base-command
, you define a command to run in order to run through your setup process. "Your
setup command" is just the command that you run. e.g. php artisan mycompany:setup
.
Essentially, your own package's Service Provider should extend the one in this project. Then you just create as many Task classes as is needed for your own setup steps.
Your own steps should extend either StepAlways
, StepBinary
or StepChoices
.
A full explanation and documentation is coming soon.
Thanks for your patience, Dave.