From 2c8d95b321938b2061ac57e3419b087199d2eab3 Mon Sep 17 00:00:00 2001 From: LT Date: Mon, 20 Jan 2025 11:45:36 +0300 Subject: [PATCH] fix: Issue Issue #1485 --- src/Core/src/Paginator/Paginator.php | 2 +- src/UI/src/Traits/Fields/UpdateOnPreview.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Core/src/Paginator/Paginator.php b/src/Core/src/Paginator/Paginator.php index 8ba759651..60cc0dffa 100644 --- a/src/Core/src/Paginator/Paginator.php +++ b/src/Core/src/Paginator/Paginator.php @@ -63,7 +63,7 @@ private function changeLinkUrls(string $path): void $changeUrl = function (?string $link) use ($path): ?string { $current = strtok($this->path, '?'); $new = strtok($path, '?'); - $query = (string) str($path)->after('?'); + $query = str($path)->contains('?') ? str($path)->after('?')->value() : ''; return $link ? trim(str_replace($current, $new, $link) . '&' . $query, '&') diff --git a/src/UI/src/Traits/Fields/UpdateOnPreview.php b/src/UI/src/Traits/Fields/UpdateOnPreview.php index 3cf144818..d008fe518 100644 --- a/src/UI/src/Traits/Fields/UpdateOnPreview.php +++ b/src/UI/src/Traits/Fields/UpdateOnPreview.php @@ -77,6 +77,9 @@ public function updateInPopover(string $component): static return $this->withUpdateRow($component); } + /** + * @param ?Closure(mixed $data, mixed $value, static $field): string $url + */ public function updateOnPreview( ?Closure $url = null, ?ResourceContract $resource = null, @@ -111,7 +114,7 @@ public function updateOnPreview( } /** - * @param Closure(mixed $data, mixed $value, self $field): string $url + * @param Closure(mixed $data, mixed $value, FieldContract $field): string $url */ public function setUpdateOnPreviewUrl(Closure $url, array $events = []): static {