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