ezappslab / laravel-evolver
Manage installation and upgrade sequences through a series of actions
Requires
- illuminate/contracts: ^10.0|^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- php: ^8.1
- larastan/larastan: ^2.9
- laravel/pint: ^1.15
- nunomaduro/collision: ^8.1
- orchestra/testbench: ^9.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
README
Evolver is a Laravel package designed to manage installation and upgrade sequences through a series of actions. It simplifies the deployment and upgrade processes by encapsulating them into actionable steps defined within your configuration file.
Installation
To install the package, use Composer:
composer require ezappslab/laravel-evolver
After installing the package, you must execute the following Artisan command to copy the necessary configuration file to your project:
php artisan evolver:install
This command copies the evolver.php configuration file into your Laravel config directory.
Configuration
Actions are defined in the evolver.php configuration file. Each action is a class that implements the Actionable interface, which requires an execute method where the action's task is defined.
Here's a basic example of an action:
namespace App\Actions; use Infinity\Evolver\Contracts\Actionable; class UpdateDatabaseSchema implements Actionable { public function execute() { // Logic to update the database schema } }
Add your actions to the evolver.php file as follows:
return [ 'install' => [ App\Actions\InitializeDatabase::class, App\Actions\SeedDatabase::class, ], 'upgrade' => [ App\Actions\UpdateDatabaseSchema::class, ], ];
Usage
The package provides two commands to execute the defined actions:
Installation command execute all installation actions defined in the configuration file:
php artisan app:install
Upgrade command execute all upgrade actions defined in the configuration file:
php artisan app:upgrade
These commands will run the respective actions in the order they are defined in the evolver.php configuration file.
Contributing
Contributions to the Evolver package are welcome. Please ensure that any pull requests are compliant with Laravel's standards and are accompanied by the necessary tests.
License
This package is open-sourced software licensed under the MIT license.