1

When the seeder is created by system A with command:

php artisan make:seeder LaravelSeeder

Then you can seed that seeder easily in system A with command:

php artisan db:seed --class=LaravelSeeder

But when the same seeder will be pushed and pulled in system B. Then it should not create again. And should be run directly with:

php artisan db:seed --class=LaravelSeeder.

But when I run this command it says

Class LaravelSeeder does not exist

So I again create the same seeder with command php artisan make:seeder LaravelSeeder.

Even after running this command it says Seeder already exists!.

  • Why the Laravel seeder behave like that?
  • Any solution to prevent from this?
thisiskelvin
  • 4,136
  • 1
  • 10
  • 17
Brn.Rajoriya
  • 1,534
  • 2
  • 23
  • 35
  • 5
    Run `composer dump autoload` and try again. And try this: https://stackoverflow.com/questions/36206742/class-usertableseeder-does-not-exist-laravel-5-0-php-artisan-dbseed?answertab=active#tab-top – Mayank Pandeyz Sep 19 '18 at 10:11
  • this command will update the auto load file right ? And autoload file will not be pushed. So do i will have to run this command every time when i will get new seeder ? – Brn.Rajoriya Sep 19 '18 at 11:36

0 Answers0