Answers for "laravel run seeder in migration"

PHP
3

laravel seed migrate

php artisan migrate:refresh --seed
Posted by: Guest on November-25-2020
2

use migration to run seeder

<?php

// inside migration file
public function up()
{
    // Create a table here

    // Call seeder
    Artisan::call('db:seed', [
        '--class' => 'SampleDataSeeder',
        '--force' => true // <--- add this line
    ]);
}
Posted by: Guest on August-14-2021

Code answers related to "laravel run seeder in migration"

Browse Popular Code Answers by Language