input('type')); if (in_array($type, [CategoryType::Savings, CategoryType::Investment], true)) { $this->merge([ 'cashflow_direction' => CategoryCashflowDirection::Outflow->value, ]); return; } if ($type !== CategoryType::Transfer) { $this->merge([ 'cashflow_direction' => CategoryCashflowDirection::Hidden->value, ]); return; } $this->merge([ 'cashflow_direction' => $this->input('cashflow_direction', CategoryCashflowDirection::Hidden->value), ]); } }