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