Ejemplo n.º 1
0
 public function run()
 {
     Eloquent::unguard();
     $rounds = Round::get();
     $games = array();
     foreach ($rounds as $round) {
         for ($gt = 1; $gt <= $round->tournament()->players()->count() / 2; $gt++) {
             $games[] = array('round' => $round->id, 'slug' => 'T ' . $gt);
         }
     }
     DB::table('games')->truncate();
     DB::table('games')->insert($games);
 }