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