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