Example #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //Unguard
     Model::unguard();
     DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     //Truncate
     Participant::truncate();
     //Event::truncate();
     Tag::truncate();
     Post::truncate();
     //Image::truncate();
     DB::statement('TRUNCATE `taggables`;');
     //DB::statement('TRUNCATE `imagables`;');
     DB::statement('TRUNCATE `participations`;');
     DB::statement('TRUNCATE `albumables`;');
     Event::reindex();
     Participant::reindex();
     User::reindex();
     Album::reindex();
     //Call
     $this->call(ParticipantTableSeeder::class);
     $this->call(EventTableSeeder::class);
     $this->call(TagTableSeeder::class);
     //Reguard
     Model::reguard();
     DB::statement('SET FOREIGN_KEY_CHECKS=1;');
 }