Package Data | |
---|---|
Maintainer Username: | edmundluong88 |
Package Create Date: | 2017-06-25 |
Package Last Update: | 2020-09-16 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-23 03:04:41 |
Package Statistics | |
---|---|
Total Downloads: | 48,348 |
Monthly Downloads: | 234 |
Daily Downloads: | 1 |
Total Stars: | 18 |
Total Watchers: | 3 |
Total Forks: | 16 |
Total Open Issues: | 5 |
Seeding as it is currently done in Laravel is intended only for dev builds, but what if you're iteratively creating your database and want to constantly flush it and repopulate it during development?
What if you want to seed a production database with different data from what you use in development? What if you want to seed a table you've added to a database that is currently in production with new data?
LaravelSeeder takes the database migration features in Laravel and extends them to database seeders, making them "migratable". All of the functionality you have grown accustomed to with Laravel migrations have been mirrored and behave similarly for seeders.
composer require eighty8/laravel-seeder
Eighty8\LaravelSeeder\SeederServiceProvider::class
to your providers array in app/config/app.php
php artisan vendor:publish
to push config files to your config folder if you want to override the name of the seeds folder or the name of the table where seeds are storedphp artisan seed
will only run seeds that haven't already been run.When you install LaravelSeeder, various artisan commands are made available to you which use the same methodology you're used to using with Migrations.
A Dockerfile with PHP 7.2, XDebug and Composer installed is bundled with the project to facilitate local development.
To easily bring up the local development environment, use the Docker Compose configuration:
docker-compose up -d --build
By default, the entrypoint script will install the Composer dependencies for you.
To run the test suite, execute the following:
docker-compose exec laravel-seeder test.sh
To run the code coverage suite, execute the following:
docker-compose exec laravel-seeder code-coverage.sh
Happy testing!