A set of commands to provision data separately from your migrations or test seeds.
Laravel comes with Migrations
, which are perfect for data structure, but feel odd for seeding data.
It also provides Seeders
which are suited for tests data ands fakes, but can’t track version, and can create confusion. LaravelProvision is here to fill the gap by providing a way to provision sequentially, your production data.
- Require the package with Composer
composer require 7ute/laravel-provision
2a. Use the install command (that will create the database/provisions
folder and publish the migration and config)
php artisan provision:install
2b. (alternate method) you can publish the migrations and config separately by running vendor:publish
php artisan vendor:publish --provider="SevenUte\LaravelProvision\ProvisionServiceProvider" --tag="laravel-provision-migrations"
php artisan vendor:publish --provider="SevenUte\LaravelProvision\ProvisionServiceProvider" --tag="laravel-provision-config"
Once you’re fine with the config (config/provision.php
), run the migration
php artisan migrate
php artisan provision {--force} {--silent}
Run the provisions that haven’t been run yet (use--force
to discard theproduction
environment confirmation input)php artisan provision:status
Checks the provisions ran so farphp artisan provision:make {name}
Creates a provision with the unique classnamename
php artisan provision:rollback {name}
Removes a provision from database with the classname or the filenamename
, allowing it to run again
The provision files are run in their chronological order.
Only the files that have not been yet provisioned are run.
You can access the current app through $this->container
and current console through $this->command
.
Fork the repository and create a pull request
Check the issues and create one if you don't find any suitable solution
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
- Spatie for everything they've done so far
- All Contributors
The MIT License (MIT). Please see License File for more information.