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