public function postAddDestinyGame(AddGameRequest $request) { $client = new DestinyClient(); $client->updateTypeOfGame($request->request->get('instanceId'), $request->request->get('type'), $request->request->get('raidTuesday')); return \Redirect::action('UserCpController@getIndex')->with('flash_message', ['type' => 'success', 'header' => 'Game Added!']); }
public function postAddGame() { $all = $this->request->all(); if (isset($all['google_id'])) { try { $user = User::where('google_id', $all['google_id'])->where('admin', true)->firstOrFail(); $client = new Client(); try { $game = $client->fetchGameByInstanceId($all['instanceId']); } catch (GameNotFoundException $e) { return $this->_error('Game could not be found'); } $client->updateTypeOfGame($all['instanceId'], Types::getProperFormat($all['type']), $all['passageId']); return Response::json(['error' => false, 'msg' => 'Game Added! '], 200); } catch (ModelNotFoundException $e) { return $this->_error('User account could not be found.'); } } }