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