Repeater - deletable except for first item

Is it possible to have repeater items have the delete action except for the first entry? In this example, a job application with a repeater for employment history but at least one is required. This is a form in a standalone Livewire component and not in a Filament panel. I'm adding an empty entry to the repeater in the component's mount() method and that works fine. I'd like that one to always be present but if they accidentally add a one (2nd, 3rd, or 17th) without meaning to, there's no way to remove it and those fields fail validation as required. So can you either disable delete or hide the delete icon for that first one? Or, if that's not possible, is there a way to filter out fully empty entries before they go through validation?
Solution:
->defaultItems(1) ->minItems(1)...
Jump to solution
3 Replies
Solution
awcodes
awcodes2mo ago
->defaultItems(1) ->minItems(1)
awcodes
awcodes2mo ago
Then just let the validation work for empty items, just let the user delete them if they don’t need them.
phydeaux
phydeauxOP2mo ago
Geez! How did I miss that? Thanks
Want results from more Discord servers?
Add your server