Exemplo n.º 1
0
 public function add(AddTeam $request)
 {
     $tournament = Tournament::findOrFail($request->input('team.tournament'));
     if (Tournament::STATUS_DRAFT !== $tournament->status) {
         throw new LogicException('Team can be assigned only to tournament with draft status.');
     }
     $team = TournamentTeam::create($request->input('team'));
     return $this->response->collection(TournamentTeam::where(['id' => $team->id])->get(), new TournamentTeamTransformer(), 'teams');
 }
Exemplo n.º 2
0
 public function remove($teamId, RemoveTeam $request)
 {
     return TournamentTeam::where(['id' => $teamId])->delete();
 }