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()
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server