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