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