repository = $jobs; parent::__construct(); } /** * Show jobs'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::$jobs.names')) ->view('$job::public.jobs.index') ->data(compact('$jobs')) ->output(); } /** * Show jobs'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::$jobs.names')) ->view('$job::public.jobs.index') ->data(compact('$jobs')) ->output(); } /** * Show jobs. * * @param string $slug * * @return response */ protected function show($slug) { $jobs = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$jobs->name . trans('$job::$jobs.name')) ->view('$job::public.jobs.show') ->data(compact('$jobs')) ->output(); } }