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