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