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