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->title(trans('$job::$job.names')) ->view('$job::public.job.index') ->data(compact('$jobs')) ->output(); } /** * Show job's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $jobs = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$job::$job.names')) ->view('$job::public.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->title($$job->name . trans('$job::$job.name')) ->view('$job::public.job.show') ->data(compact('$job')) ->output(); } }