public function EV3()
 {
     $faker = Faker::create();
     $data = CombatRound::where('challenge_id', '=', 1)->get();
     foreach ($data as $d) {
         $score1 = $faker->numberBetween($min = 2, $max = 3);
         $score2 = $faker->numberBetween($min = 2, $max = 3);
         if ($score1 == 3 && $score2 == 3) {
             $score1 = $score1 - 1;
         }
         if ($score1 == 2 && $score2 == 2) {
             $score2 = $score2 + 1;
         }
         if ($score1 > $score2) {
             $win = $d['versus_one'];
         } else {
             if ($score2 > $score1) {
                 $win = $d['versus_two'];
             }
         }
         Sumo::create(['combat_id' => $d['id'], 'team_id_win' => $win, 'team_id_one' => $d['versus_one'], 'scort_team_one' => $score1, 'firm_team_one' => $faker->numberBetween($min = 1, $max = count(User::get())), 'team_id_two' => $d['versus_two'], 'scort_team_two' => $score2, 'firm_team_two' => $faker->numberBetween($min = 1, $max = count(User::get()))]);
     }
 }
 public function firm(Request $request)
 {
     $data = Tool::removeSpace($request->all());
     $validator = Validator::make($data, ["firma_equipo_uno" => "required|integer", "firma_equipo_dos" => "required|integer"]);
     $firmOne = $this->evalFirms($data['equipo_uno'], $data['firma_equipo_uno']);
     $firmTwo = $this->evalFirms($data['equipo_dos'], $data['firma_equipo_dos']);
     $toArray = $validator->errors()->toArray();
     if ($validator->fails()) {
         return response()->json(['type' => 'uno', 'success' => false, 'errors' => $toArray]);
     } elseif (!$firmOne) {
         return response()->json(['type' => 'dos', 'firmOne' => ['message' => 'Lo sentimos esta firma no coincide con integrantes del equipo']]);
     } elseif (!$firmTwo) {
         return response()->json(['type' => 'tres', 'firmTwo' => ['message' => 'Lo sentimos esta firma no coincide con integrantes del equipo']]);
     } else {
         Sumo::create(['combat_id' => $request->combat_id, 'team_id_win' => $request->win, 'team_id_one' => $request->equipo_uno, 'scort_team_one' => $request->puntaje_equipo_one, 'team_id_two' => $request->equipo_dos, 'scort_team_two' => $request->puntaje_equipo_dos, 'firm_team_one' => $request->firma_equipo_uno, 'firm_team_two' => $request->firma_equipo_dos]);
         $com = CombatRound::find($request->combat_id);
         $com->completed = 1;
         $com->save();
         return response()->json(['type' => 'cuatro', 'success' => true]);
     }
 }