public function scopeSearch(Builder $query, ?string $search = null): Builder 	{ 		$search = preg_replace('/\s+/', '%', $search ?? ''); 		$search = empty($search) ? null : '%' . $search . '%';  		return !$search ? $query : $query->where(function (Builder $query) use ($search) { 			$query->where('name', 'like', $search)->orWhereHas('tags', function (object $query) use ($search): void { 				$query->whereHas('tag', function (object $query) use ($search): void { 					$query->where('name', 'like', $search); 				}); 			})->orWhere('tax_number', 'like', $search) 			->orWhere('industry', 'like', $search); 		}); 	}