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