Laravel 5.3 db:seed command simply doesn't work

余生长醉 提交于 2019-12-03 04:55:42

Are you calling your seeder inside the DatabaseSeeder class? This way:

database/seeds/DatabaseSeeder.php

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $this->call(QuotationTableSeeder::class);
    }
}

Or, add the --class option when using the php artisan db:seed command, this way:

php artisan db:seed --class="QuotationTableSeeder"

After creating or removing your seeders, don't forget to run the following command:

composer dump-autoload

If anybody else is having issues with migrating AND seeding at the same time, please try

php artisan migrate:fresh --seed

Worked for me..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!