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