public function scopeSearch(Builder $query, ?string $search = null): Builder 	{ 		$search = preg_replace('/\s+/', '%', $search ?? ''); 		$search = $search ? '%' . $search . '%' : null;  		return $search ? $query->where(static function (Builder $query) use ($search): void { 			$query->orWhere('id', 'like', $search) 				->orWhere('external_id', 'like', $search) 				->orWhere('from', 'like', $search) 				->orWhere('to', 'like', $search); 		}) : $query; 	}