repository = $game; parent::__construct(); } /** * Show game's list. * * @param string $slug * * @return response */ protected function index() { $games = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->setMetaTitle(trans('game::game.names')) ->view('game::public.game.index') ->data(compact('games')) ->output(); } /** * Show game. * * @param string $slug * * @return response */ protected function show($slug) { $game = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->setMetaTitle($game->name . trans('game::game.name')) ->view('game::public.game.show') ->data(compact('game')) ->output(); } }