Created
June 26, 2017 00:14
-
-
Save kvn1234/d87f079289991d90b741956e60948e94 to your computer and use it in GitHub Desktop.
How to add a seed after migration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
***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