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