watchout when afterStateUpdated from another component

i have this code
Forms\Components\Checkbox::make('Check All')
                    ->columnSpan('full')
                    ->live()
                    ->reactive()
                    ->afterStateUpdated(function (Forms\Get $get, Forms\Set $set, $state) {
                        $paymentDetails = $get('payment_details');
                        if ($state) {
                            if (is_array($paymentDetails)) {
                                foreach ($paymentDetails as &$detail) {
                                    if (isset($detail['is_checked'])) {
                                        $detail['is_checked'] = true; // Set the checked_value to true
                                    }
                                }
                            }
                        }else  {
                            if (is_array($paymentDetails)) {
                                foreach ($paymentDetails as &$detail) {
                                    if (isset($detail['is_checked'])) {
                                        $detail['is_checked'] = false; // Set the checked_value to true
                                    }
                                }
                            }
                        }
                        $set('payment_details', $paymentDetails);
                    }),

is_checked is checkBox component that is in a repeater so when using the above logic to make all true i want to trigger some logic but my afterStateUpdated function of is_cheked is not triggered how can i do this please Help me guys.
Was this page helpful?