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