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