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