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:
7 Replies
I tried using this:
What I want is to create a model after the user clicks the
createItem
. So adding Parent::create([])
The docs talk about the (Livewire) „component“ which is the Page in your case, not the Field. You can use the methods inside the setup method.
So, I have a livewire component
ApplicationForm.php
and I added this:
Then I tested it by clicking a delete in the repeater, the dd()
did not fire.
The ->setUp()
kinda belongs to a custom field.Yes it does.
Oh, do you need to extend the Repeater then? 🤔
So the docs is referring to a custom field and not for my livewire page?
I ran into the same problem. dd() does not fire when I create a
protected function setUp()
with $this->registerListeners
while listening for any repeater::x
event but it works when I add the registerListeners()
method to the repeater field