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