Beispiel #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //Truncate
     DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     User::truncate();
     Admin::truncate();
     Customer::truncate();
     Address::truncate();
     Category::truncate();
     Product::truncate();
     Brand::truncate();
     Type::truncate();
     Image::truncate();
     DB::statement('TRUNCATE category_product;');
     Product::clearIndices();
     Product::reindex();
     //Unguard
     Model::unguard();
     //Call
     $this->call(UsersTableSeeder::class);
     $this->call(ProductsTableSeeder::class);
     //Reguard
     Model::reguard();
     DB::statement('SET FOREIGN_KEY_CHECKS=1;');
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // clear table
     \App\Type::truncate();
     // add 1st row
     \App\Type::create(['name' => 'Бүтэн цагийн']);
     // add 2nd row
     \App\Type::create(['name' => 'Хагас цагийн']);
     \App\Type::create(['name' => 'Гэрээт']);
     \App\Type::create(['name' => 'Түр зуурын']);
     \App\Type::create(['name' => 'Дадлагажилт']);
 }