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