Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how run all seeder at once in laravel

make DatabaseSeerder class and call function with seeder Array
<?php
  
namespace DatabaseSeeders;
  
use IlluminateDatabaseSeeder;
  
class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        $this->call([
            UserSeeder::class
            AdminSeeder::class
        ]);
    }
}
Source by www.itsolutionstuff.com #
 
PREVIOUS NEXT
Tagged: #run #seeder #laravel
ADD COMMENT
Topic
Name
1+4 =