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'); }
public function remove($teamId, RemoveTeam $request) { return TournamentTeam::where(['id' => $teamId])->delete(); }