I’m building a dashboard using the filament library and I’m liking it so far. I have a repeater that allows me to add new languages to the app and I want to hide the delete icon if the current item is the default language. According to the documentation, the delete icon is controlled with the ->delectable()
method. So basically I need to check if the current item value is different than the default language but I’m unable to get the current item value:
Repeater::make('languages')->schema([
Select::make('code')
->prefixIcon('heroicon-o-language')
->label('Language')
->options(collect(locales())->pluck('name', 'code'))
->searchable()
->required(),
])
->hiddenLabel()
->reorderable(false)
->grid(2)
// ->deletable(<condition>)
->maxItems(count(locales()))
->addActionLabel('+ Add new language')
])
I hope the issue is clear enough and any help will be appreciated and thanks