© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
4 replies
Glennynator

Make only specific repeater elements non-deletabel

Hi, I wonder if it is currently possible to make only specific repeater items nonDeletable


    public static function getItemsRepeater(): Repeater
    {
        return Repeater::make('orderItems')
            ->relationship('orderItems') // This links the Repeater to the hasMany relationship on Order
            ->schema([
                Grid::make(['md' => 12])->schema([
                    TextInput::make('quantity')
                        ->label('Quantity')
                        ->numeric()
                        ->default(1)
                        ->required()
                        ->suffix('pcs')
                        ->columnSpan(['md' => 2])
  ......

                    TextInput::make('meta')
                        ->label('Meta')
                        ->columnSpan(['md' => 2])
                    ,
                ])->disabled(fn($get) => filled($get('invoice_id')))
                ,
            ])
            ->deletable(fn($get) => blank($get('invoice_id'))) // <- This disables delete button
            ->defaultItems(0)
            ->hiddenLabel()
            ->columns(['md' => 10]);
    }
    public static function getItemsRepeater(): Repeater
    {
        return Repeater::make('orderItems')
            ->relationship('orderItems') // This links the Repeater to the hasMany relationship on Order
            ->schema([
                Grid::make(['md' => 12])->schema([
                    TextInput::make('quantity')
                        ->label('Quantity')
                        ->numeric()
                        ->default(1)
                        ->required()
                        ->suffix('pcs')
                        ->columnSpan(['md' => 2])
  ......

                    TextInput::make('meta')
                        ->label('Meta')
                        ->columnSpan(['md' => 2])
                    ,
                ])->disabled(fn($get) => filled($get('invoice_id')))
                ,
            ])
            ->deletable(fn($get) => blank($get('invoice_id'))) // <- This disables delete button
            ->defaultItems(0)
            ->hiddenLabel()
            ->columns(['md' => 10]);
    }
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Repeater Delete specific records only
FilamentFFilament / ❓┊help
12mo ago
Help: Form Repeater -> Make Values Selectable Only Once
FilamentFFilament / ❓┊help
2y ago
Make hidden repeater
FilamentFFilament / ❓┊help
2y ago
make repeater validation
FilamentFFilament / ❓┊help
2y ago