© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
marcosmarcolin

Retrieve ID of selected child from related table

Hello everyone, I can't retrieve the id of the table related to the Resource, is there any way?

Ex: I have a Questions Resource and it has a Relationship with Options. When I edit a Question it lists all the Options, so far ok.

I'm doing a custom action on the relationship, and I would like to retrieve the id of the record I'm clicking on.

When I use
$this->getOwnerRecord()
$this->getOwnerRecord()
I am retrieving the id of the Father, is there a way to retrieve the id of the selected child?


->actions([
Tables\Actions\ViewAction::make(),
        Tables\Actions\Action::make('questions')->label('')->icon('heroicon-o-question-mark-circle')
           ->action(
                fn () => redirect()->route('filament.admin.resources.onboarding.show-questions', [$this->getOwnerRecord(), ?])
           ),
])
->actions([
Tables\Actions\ViewAction::make(),
        Tables\Actions\Action::make('questions')->label('')->icon('heroicon-o-question-mark-circle')
           ->action(
                fn () => redirect()->route('filament.admin.resources.onboarding.show-questions', [$this->getOwnerRecord(), ?])
           ),
])


My route/page expects two parameters, I send the first with
$this->getOwnerRecord()
$this->getOwnerRecord()
, but the second, which would be the id of the selected line, I cannot retrieve.

Thanks.
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

Getting results from the child table
FilamentFFilament / ❓┊help
3y ago
Sum of items selected on table?
FilamentFFilament / ❓┊help
2y ago
Filtering by a related table column changes the table id
FilamentFFilament / ❓┊help
3y ago
Update related table
FilamentFFilament / ❓┊help
3y ago