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('name', $search, 'like'); 				}) 				->orWhere(static function (object $query) use ($search): void { 					$query->viaTranslatedSlug($search, 'like'); 				}); 		}) : $query; 	}