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