How to customize Repeater form events?

I've read the documentation found on https://filamentphp.com/docs/2.x/forms/advanced#using-form-events but I don't understand any single thing.

I don't understand how to implement this:

protected function setUp(): void
{
    parent::setUp();
 
    $this->registerListeners([
        'repeater::deleteItem' => [
            function (Component $component, string $statePath, string $uuidToDelete): void {
                if ($component->isDisabled()) {
                    return;
                }
 
                if ($statePath !== $component->getStatePath()) {
                    return;
                }
 
                // Delete item with UUID `$uuidToDelete`
            },
        ],
    ]);
}
Filament
The elegant TALL stack form builder for Laravel artisans.
Was this page helpful?