From 3e74448123f3fe144ccd30c9d63d14ca2be973dd Mon Sep 17 00:00:00 2001 From: alex-chevski Date: Sat, 16 Dec 2023 22:19:08 +0300 Subject: [PATCH] fixed empty items delete in create plan --- app/Livewire/Plan/Create.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Livewire/Plan/Create.php b/app/Livewire/Plan/Create.php index 98bdc2e..9d776d1 100644 --- a/app/Livewire/Plan/Create.php +++ b/app/Livewire/Plan/Create.php @@ -100,6 +100,9 @@ class Create extends Component $this->$options_type['items'][] = $this->input_items_1; $this->$options_type['items'][] = $this->input_items_2; $this->$options_type['items'][] = $this->input_items_3; + + // delete empty value in items + $this->$options_type['items'] = array_filter($this->$options_type['items'], fn($item) => !empty($item)); $this->reset('input_items_1'); $this->reset('input_items_2'); $this->reset('input_items_3');