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