How to make Repeater unique fields name

I have a fields repeater. this fields have a name. the name must be unique. how to do it (,: ?
Repeater::make('fields')
    ->defaultItems(1)
    ->hiddenLabel()
    ->required()
    ->itemLabel(function (array $state): string {
        return $state['name'] ?? '-';
    })
    ->grid()
    ->cloneable()
    ->reorderable()
    ->label(__('Fields'))
    ->collapsible()
    ->addActionLabel(__('Add field'))
    ->schema([
        Forms\Components\TextInput::make('name')
            ->required()
            ->label(__('Name'))
            ->live()
        ,
    ])
,

i tried to use the ->different()
Screenshot_2023-12-15_at_11.32.38.png
Was this page helpful?