From 355215fd42b8991330b860c36923aca2e8f5fdc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sat, 21 Oct 2023 03:24:11 +0000 Subject: [PATCH] fix --- src/Fields/Slug.php | 3 ++- src/Http/Controllers/ActionController.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fields/Slug.php b/src/Fields/Slug.php index 49966bf10..44fb50763 100644 --- a/src/Fields/Slug.php +++ b/src/Fields/Slug.php @@ -5,6 +5,7 @@ use Closure; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Http\Request; use Illuminate\Support\Str; use Illuminate\Validation\Rule; @@ -152,7 +153,7 @@ static function (Builder $query): Builder { $value = is_null($match) ? $value : preg_replace_callback( sprintf('/%s([\d]+)?$/', preg_quote($this->separator)), static function (array $match): string { - return str_replace($match[1], ((int) $match[1]) + 1, $match[0]); + return str_replace($match[1], (string) (((int) $match[1]) + 1), $match[0]); }, $match ); diff --git a/src/Http/Controllers/ActionController.php b/src/Http/Controllers/ActionController.php index 6d0c4c6df..4f0421e1a 100644 --- a/src/Http/Controllers/ActionController.php +++ b/src/Http/Controllers/ActionController.php @@ -13,6 +13,7 @@ class ActionController extends Controller */ public function __invoke(Request $request): RedirectResponse { + /** @var \Cone\Root\Actions\Action $action */ $action = $request->route('rootAction'); Gate::allowIf($action->authorized($request));