© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
Ayman Alhattami

Get field data of parent repeater from nested repeater

I have two nested repeaters and from the second repeater I want to get the data of parent repeater

The way in the documentation does not work with me to get parent repeater data
https://filamentphp.com/docs/3.x/forms/fields/repeater#using-get-to-access-parent-field-values

Forms\Components\Select::make('currency_id')
    ->translateLabel()
    ->required()
    ->relationship('currency', 'name')
    ->searchable()
    ->preload()
    ->live(),
Forms\Components\Repeater::make('journalEntries')
    ->relationship('journalEntries')
    ->schema([
        Forms\Components\Select::make('chart_of_account_id')
             ->relationship(name: 'chartOfAccount', titleAttribute: 'name', modifyQueryUsing: function ($query) {
                  return $query->kids();
             }),
        Forms\Components\TextInput::make('debit')->live(),
        Forms\Components\TextInput::make('credit')->live(),
        Forms\Components\TextInput::make('description'),
        Forms\Components\Repeater::make('costCenterJournalEntries')
             ->relationship('costCenterJournalEntries')
             ->schema([
                   Forms\Components\Select::make('cost_center_id')
                        ->relationship(name: 'costCenter', titleAttribute: 'name', modifyQueryUsing: function ($query) {
                                    return $query->kids();
                                }),
                   Forms\Components\TextInput::make('amount'),
             ])->live()
        ])->live()
Forms\Components\Select::make('currency_id')
    ->translateLabel()
    ->required()
    ->relationship('currency', 'name')
    ->searchable()
    ->preload()
    ->live(),
Forms\Components\Repeater::make('journalEntries')
    ->relationship('journalEntries')
    ->schema([
        Forms\Components\Select::make('chart_of_account_id')
             ->relationship(name: 'chartOfAccount', titleAttribute: 'name', modifyQueryUsing: function ($query) {
                  return $query->kids();
             }),
        Forms\Components\TextInput::make('debit')->live(),
        Forms\Components\TextInput::make('credit')->live(),
        Forms\Components\TextInput::make('description'),
        Forms\Components\Repeater::make('costCenterJournalEntries')
             ->relationship('costCenterJournalEntries')
             ->schema([
                   Forms\Components\Select::make('cost_center_id')
                        ->relationship(name: 'costCenter', titleAttribute: 'name', modifyQueryUsing: function ($query) {
                                    return $query->kids();
                                }),
                   Forms\Components\TextInput::make('amount'),
             ])->live()
        ])->live()
Repeater - Form Builder - Filament
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

Get parent data inside a repeater
FilamentFFilament / ❓┊help
3y ago
Get Nested Parent
FilamentFFilament / ❓┊help
6mo ago
Repeater get data from form
FilamentFFilament / ❓┊help
17mo ago
How to store data of a nested repeater field with relationships?
FilamentFFilament / ❓┊help
3y ago