public function scopeSearch(object $query, ?string $search = null): Builder 	{ 		$search = preg_replace('/\s+/', '%', $search ?? ''); 		$search = empty($search) ? null : '%' . $search . '%';  		return !$search ? $query : $query->where(function (object $query) use ($search): void { 			$query->orWhere($this->getKeyName(), 'like', $search) 				->orWhere(function (object $query) use ($search): void { 					$query->hasTranslatedField('title', $search, 'like'); 				}) 				->orWhere(function (object $query) use ($search): void { 					$query->viaTranslatedSlug($search, 'like'); 				}) 				->orWhere(function (object $query) use ($search): void { 					$query->searchByTag($search); 				}); 		}); 	}