public function scopeSearch(Builder $query, ?string $search = null): Builder 	{ 		$search = preg_replace('/\s+/', '%', $search ?? ''); 		$search = empty($search) ? null : '%' . $search . '%';  		return !$search ? $query : $query->where('name', 'like', $search)->orWhere(function ($query) use ($search) { 			$query->whereHas('translations', function ($query) use ($search) { 				$query->where('column', 'name')->where(function ($query) use ($search) { 					$query->orWhere('value', 'like', $search); 				})->orWhere('column', 'slug')->where(function ($query) use ($search) { 					$query->orWhere('value', 'like', $search); 				}); 			}); 		}); 	}