Update CreateRecord.php

This commit is contained in:
PixelBeardWill
2025-07-10 10:32:21 +01:00
parent 9d9e0195d7
commit 107ffaa772
@@ -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;
}