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