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