search; $pageLimit = $request->input('pageLimit', config('database.pagination.limit')); $page = Subcategory::pushScope(new RequestScope()) ->pushScope(new SubcategoryPublicScope()) ->paginate($pageLimit) ->withQueryString(); $subcategories = new SubcategoriesCollection($page); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('subcategory::subcategory.names')) ->view('subcategory::public.subcategory.index') ->data(compact('subcategories', 'categories', 'tags', 'recent')) ->output(); } /** * Show subcategory. * * @param string $slug * * @return response */ protected function show(PublicRequest $request, $slug) { $model = Subcategory::findBySlug($slug); $data = new SubcategoryResource($model); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle($data['title'] . trans('subcategory::subcategory.name')) ->view('subcategory::public.subcategory.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }