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