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