xxxxxxxxxx
<?php
// inside migration file
public function up()
{
// Create a table here
// Call seeder
Artisan::call('db:seed', [
'--class' => 'SampleDataSeeder',
'--force' => true // <--- add this line
]);
}
xxxxxxxxxx
php artisan make:model MODEL_PATH\MODEL_NAME -ms
-m, --migration Create a new migration file for the model.
-s, --seeder Create a new seeder file for the model.