public function addParsedGame(GameMlsEntity $gameEntity) { $gameBO = new GameMlsBO($gameEntity); $data = $gameBO->toArray(); $validator = Validator::make($data, GameRequest::getRules()); if (!$validator->fails()) { $game = Game::where('mls_url', $data['mls_url'])->first(); if (!$game) { $game = Game::create($data); if (strpos($data['icon'], 'players-ico.png') === false && $data['icon'] != config('mls.domain')) { copy($data['icon'], public_path() . '/img/team_logos/' . str2url($game->team) . '.png'); } return $game; } } return false; }
public function update(Game $game, GameRequest $request) { $game->update($request->all()); Flash::success(trans('general.updated_msg')); return redirect(route('admin.games')); }