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