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