public function update($tournamentId) { /** * @var Tournament $tournament */ $tournament = Tournament::findOrFail($tournamentId); $tournament->update(['name' => Input::get('tournament.name'), 'type' => Input::get('tournament.type'), 'status' => Input::get('tournament.status'), 'membersType' => Input::get('tournament.membersType'), 'description' => Input::get('tournament.description')]); return $this->response->collection(Tournament::where(['id' => $tournamentId])->get(), new TournamentTransformer(), 'tournaments'); }
/** * Method responsible for getting * the desired tournament. * * @param Administrator $admin * @param str $name * * @throws Illuminate\Database\Eloquent\ModelNotFoundException * * @return Tournament */ private function retrieveTournament(Administrator $admin, $name) { return Tournament::where('name', $name)->where('created_by', $admin->id)->firstOrFail(); }