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