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?3 Replies