Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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
    ]);
}
Source by owenconti.com #
 
PREVIOUS NEXT
Tagged: #migration #run #seeder
ADD COMMENT
Topic
Name
7+5 =