diff --git a/packages/forms/src/Components/Concerns/InteractsWithToolbarButtons.php b/packages/forms/src/Components/Concerns/InteractsWithToolbarButtons.php index cd348cdaba..1bdad1b80c 100644 --- a/packages/forms/src/Components/Concerns/InteractsWithToolbarButtons.php +++ b/packages/forms/src/Components/Concerns/InteractsWithToolbarButtons.php @@ -31,7 +31,7 @@ trait InteractsWithToolbarButtons } $this->toolbarButtons = array_reduce( - $this->toolbarButtons, + $this->toolbarButtons ?? [], function ($carry, $button) use ($buttonsToDisable) { if (is_array($button)) { $carry[] = array_values(array_filter( @@ -60,7 +60,7 @@ trait InteractsWithToolbarButtons } $this->toolbarButtons = [ - ...$this->toolbarButtons, + ...$this->toolbarButtons ?? [], ...$buttonsToEnable, ];