Smart Seeder adds the same methology to seeding that is currently used with migrations in order to let you seed in batches, seed to production databases or other environments, and to rerun seeds without wiping out your data.
jlapp/smart-seeder is a Laravel package for smart seeder adds the same methology to seeding that is currently used with migrations in order to let you seed in batches, seed to production databases or other environments, and to rerun seeds without wiping out your data..
It currently has 190 GitHub stars and 3.075 downloads on Packagist.
Install it with composer require jlapp/smart-seeder.
Discover more Laravel packages by jlapp
or browse all Laravel packages to compare alternatives.
Last updated
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?
php artisan seed will only run seeds that haven't already been run.php artisan db:seed
or
php artisan migrate:refresh --seed
When you install SmartSeeder, various artisan commands are made available to you which use the same methodology you're used to using with Migrations.
| seed:run | Runs all the seeds in the smartSeeds directory that haven't been run yet. |
| seed:make | Makes a new seed class in the environment you specify. |
| seed:rollback | Rollback doesn't undo seeding (which would be impossible with an auto-incrementing primary key). It just allows you to re-run the last batch of seeds. |
| seed:reset | Resets all the seeds. |
| seed:refresh | Resets and re-runs all seeds. |
| seed:install | You don't have to use this... it will be run automatically when you call "seed" |