Answers for "migration and seeding command"

PHP
1

rerun migration and seed

php artisan migrate:refresh

php artisan migrate:refresh --seed
Posted by: Guest on August-05-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 "migration and seeding command"

Browse Popular Code Answers by Language