© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•4mo ago•
3 replies
AkatsukiAri

Access Parent Record In forms or anywhere of nested resources

I want to access parent resource in form class of a nested resource:

TextInput::make('order')
                            ->label('Display Order')
                            ->numeric()
                            ->minValue(1)
                            ->default(fn ($livewire) => $livewire->getOwnerRecord()->categories()->max('order') + 1 ?? 1)
                            ->helperText('Order in which this category appears in scoring forms (1 = first)')
                            ->disabled(fn (?string $operation) => $operation !== Operation::Create->value),
TextInput::make('order')
                            ->label('Display Order')
                            ->numeric()
                            ->minValue(1)
                            ->default(fn ($livewire) => $livewire->getOwnerRecord()->categories()->max('order') + 1 ?? 1)
                            ->helperText('Order in which this category appears in scoring forms (1 = first)')
                            ->disabled(fn (?string $operation) => $operation !== Operation::Create->value),



TernaryFilter::make('has_completed_scoring')
                ->label('Completed Scoring')
                ->queries(
                    true: fn (Builder $query, Page $livewire) => self::filterCompletedScoring($query, $livewire->getParentRecord(), true),
                    false: fn (Builder $query, Page $livewire) => self::filterCompletedScoring($query, $livewire->getParentRecord(), false),
                ),
TernaryFilter::make('has_completed_scoring')
                ->label('Completed Scoring')
                ->queries(
                    true: fn (Builder $query, Page $livewire) => self::filterCompletedScoring($query, $livewire->getParentRecord(), true),
                    false: fn (Builder $query, Page $livewire) => self::filterCompletedScoring($query, $livewire->getParentRecord(), false),
                ),


Now how to access it and which livewire should I import?
And how to do it for Actions? Filters?
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

Access parent record in RepeatableEntry
FilamentFFilament / ❓┊help
3y ago
Access parent $record in relation manager
FilamentFFilament / ❓┊help
2y ago
How to call parent record in a nested form?
FilamentFFilament / ❓┊help
6mo ago
Route in Nested Resources
FilamentFFilament / ❓┊help
3y ago