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