Answers for "fresh migration and seed"

PHP
1

laravel migration seed fresh

php artisan migrate:fresh --seed
Posted by: Guest on August-30-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

Browse Popular Code Answers by Language