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