Laravel -Force run db:seed in production

If you are running a laravel job in production, and you are trying to seed data into your database table through a job then it might fail since in production db:seed and migration waits for user response on this prompt

Application In Production! *
Do you really wish to run this command? (yes/no)

To fix this, you can add the force parameter to the command like below.

 $this->call('db:seed', [
            '--class' => 'CommentsTableSeeder',
            '--force'   => true

Site Footer