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