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