/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Combat::getindex(1);
     Combat::getindex(2);
     Combat::getindex(3);
     Combat::getindex(4);
     Combat::getindex(5);
     Combat::getindex(7);
     Combat::getindex(8);
 }
 public static function functionTwo(array $data)
 {
     $dataCha = CombatRoundController::getInfoChallenge($data['challenge_id']);
     $horaInicio = CombatRoundController::verific($data);
     $dataGroup = CombatRound::where('group_id', '=', $data['group_id'])->orderBy('versus_one', DB::raw('RAND()'))->get();
     for ($i = 0; $i <= count($dataGroup) - 1; $i++) {
         $horaInicio = CombatRoundController::verific($data, $val = true);
         $dataTime = CombatRoundController::incremetTime(['time_start' => $horaInicio, 'time_durat' => $dataCha->duration]);
         $horaInicio = $dataTime['hora_end'];
         $verifi = CombatRound::where('id', '=', $dataGroup[$i]['id'])->where('schedule_end', '!=', '00:00:00')->where('schedule_start', '!=', '00:00:00')->get();
         if (count($verifi) == 0) {
             $daCo = CombatRound::find($dataGroup[$i]['id']);
             $daCo->schedule_start = $dataTime['hora_star'];
             $daCo->schedule_end = $dataTime['hora_end'];
             $daCo->save();
         }
     }
 }
 public static function FindCombat($id)
 {
     $data = Con::pagination($id);
     $challenge = Challenge::find($id);
     $challenge_name = $challenge->name;
     foreach ($data as $d) {
         $data = Groupsta::where('group_id', '=', $d['id'])->select('round_id')->get()->toArray();
         $arrayBuild = CombatRoundController::buildArray($data);
         $valore = CombatRoundController::funPru($arrayBuild);
         $dataGroup = Group::find($d['id']);
         foreach ($valore as $val) {
             $dat = CombatRound::where('group_id', '=', $d['id'])->where('versus_one', '=', $val['0'])->where('versus_two', '=', $val['1'])->where('challenge_id', '=', $id)->get();
             if (count($dat) <= 0) {
                 CombatRound::create(['group_id' => $d['id'], 'stage_id' => $dataGroup->stage_id, 'versus_one' => $val['0'], 'versus_two' => $val['1'], 'challenge_id' => $d['challenge_id']]);
             }
         }
     }
     $data = CombatRoundController::getRoundInfo($id);
     dd($data);
     if (!ENV('DEVELOP')) {
         return view('combatround.index', compact('data', 'challenge_name'));
     }
 }