SelectColumn with carbon

Hello! If i click on the previous or next month it shows that it goes 2 months back or forward but it saves as 1 month back or forward. can anyone tell me how i fix that it will only shows 1 month forward of backwards

 SelectColumn::make('invoice_month')
            ->options(function (Invoice $record) {[
                $previousMonth = Carbon::parse($record->invoice_month)->subMonth()->format('Y-m'),
                $currentMonth = Carbon::parse($record->invoice_month)->format('Y-m'),
                $nextMonth = Carbon::parse($record->invoice_month)->addMonth()->format('Y-m')
                ];
                return [
                    $previousMonth => $previousMonth,
                    $currentMonth => $currentMonth,
                    $nextMonth => $nextMonth,
                ];
            }),
Was this page helpful?