How to customize repeater delete Item?

When using repeater::deleteItem on a certain Repeater, suddenly it affects to other Repeater. I have repeater for parents, children, activities. Everytime I delete an item from activities, a notification from Parent Repeater triggers.


Repeater::make('parents')
  ->registerListeners([
    'repeater::deleteItem' => [
        function (Component $component, string $statePath, string $uuidToDelete): void { 
            ....
            if() {

            }else{
              Notification::make()
                    ->title('Unable to delete this parent')
                     ->body('The application must have at least 1 parent.')
                     ->danger()
                     ->send();
            }
        }
      ]
  ])
Was this page helpful?