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