Answers for "how to run migration and seeder command in laravel"

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 "how to run migration and seeder command in laravel"

Browse Popular Code Answers by Language