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