Home > Software engineering >  How to run a seeder file already runned file in laravel?
How to run a seeder file already runned file in laravel?

Time:05-18

i am using Laravel seeder for inserting some data , it's already seeded without any errors now i added some extra data in the same file how can i run that same seeder file again...?

file_name is `2022_05_13_110617_dummyDataSeeder.php`

command i ran :- `php artisan db:seed`

CodePudding user response:

You can specify class to run while db:seed

Example command

php artisan db:seed --class=ClassNameHere

Docs Link: https://laravel.com/docs/9.x/seeding#running-seeders

CodePudding user response:

If you are in development and don't mind the data being deleted first (NOTE DATA WILL BE LOST) then run:

php artisan migrate:fresh --seed

Make sure you have backups.

  • Related