From 107ffaa772656cf79db264b212246a8aebb0ced3 Mon Sep 17 00:00:00 2001 From: PixelBeardWill Date: Thu, 10 Jul 2025 10:32:21 +0100 Subject: [PATCH] Update CreateRecord.php --- packages/panels/src/Resources/Pages/CreateRecord.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/panels/src/Resources/Pages/CreateRecord.php b/packages/panels/src/Resources/Pages/CreateRecord.php index 742b30dd52..f11a57ad71 100644 --- a/packages/panels/src/Resources/Pages/CreateRecord.php +++ b/packages/panels/src/Resources/Pages/CreateRecord.php @@ -44,6 +44,8 @@ class CreateRecord extends Page protected static bool $canCreateAnother = true; + public bool $isCreating = false; + public function getBreadcrumb(): string { return static::$breadcrumb ?? __('filament-panels::resources/pages/create-record.breadcrumb'); @@ -74,6 +76,10 @@ class CreateRecord extends Page public function create(bool $another = false): void { + if ($this->isCreating) return; + + $this->isCreating = true; + $this->authorizeAccess(); try { @@ -99,10 +105,14 @@ class CreateRecord extends Page $this->rollBackDatabaseTransaction() : $this->commitDatabaseTransaction(); + $this->isCreating = false; + return; } catch (Throwable $exception) { $this->rollBackDatabaseTransaction(); + $this->isCreating = false; + throw $exception; } @@ -119,6 +129,8 @@ class CreateRecord extends Page $this->fillForm(); + $this->isCreating = false; + return; }