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