Skip to content

Tag: laravel-seeding

laravel seed rollback after seeding database

I have seeded my DB using php artisan db::seed. Is there a way to rollback what I have seeded into my DB? I cannot seem to find any command like php artisan db::seed rollback. Answer use Undo Seeder for Laravel. When you install UndoSeeder, the following artisan commands are made available: more Undo-Seeder

Laravel seeder for table that is hardcoded

I have several tables in my database that are simply used for reference in my application. For example, a table that has two columns, State and State Abbreviation, and has all 50 states and their abbreviations as rows. I want to write seeders for these tables in Laravel, since I want these tables to exist whe…