Skip to content

Instantly share code, notes, and snippets.

@kvn1234
Created June 26, 2017 00:14
Show Gist options
  • Save kvn1234/d87f079289991d90b741956e60948e94 to your computer and use it in GitHub Desktop.
Save kvn1234/d87f079289991d90b741956e60948e94 to your computer and use it in GitHub Desktop.
How to add a seed after migration
***new migrations might need seeds in laravel. If you try to run "php artisan migrate --seed", artisan will choke on it.
***the solution is to call the seeder from the migration:
public function up()
{
//schema changes here
//now the data migration
Artisan::call('db:seed', [
'--class' => MigrationSpecificSeeder::class,
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment