diff --git a/app/View/Components/Form/Group/Category.php b/app/View/Components/Form/Group/Category.php index cb3222dd1..008fc99d1 100644 --- a/app/View/Components/Form/Group/Category.php +++ b/app/View/Components/Form/Group/Category.php @@ -37,6 +37,10 @@ class Category extends Form $this->categories->put($model->category->id, $model->category->name); } + if($model = $this->getParentData('model')) { + $this->selected = $model->category_id; + } + if (empty($this->selected) && (in_array($type, ['income', 'expense']))) { $this->selected = setting('default.' . $type . '_category'); }