-2

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`
usersuser
  • 167
  • 12
  • 2
    https://laravel.com/docs/9.x/seeding#running-seeders – Ruub May 17 '22 at 08:06
  • Did you create seeder or migration? Your filename looks like a migration. To rerun the migration you should rollback using `php artisan migrate:rollback` and the migrate again. – Alex Jose May 17 '22 at 08:11

2 Answers2

1

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

Akhzar Javed
  • 616
  • 6
  • 12
0

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.

enjaytee
  • 1
  • 1