© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
20 replies
barrerakj

How to get the current relationship entry on a RelationManager action?

My goal is to get the current relationship information, let me explain. Let's say that I have an Order model, a Product model and a many to many relationship between them using BelongsToMany in both models. I'm using a relation manager to attach products to an order.

For example, If I use this on an AttachAction

->after(function (RelationManager $livewire) {
                        dd($livewire->mountedTableActionData['recordId'];
                        $livewire->emit('refresh');
                    })
->after(function (RelationManager $livewire) {
                        dd($livewire->mountedTableActionData['recordId'];
                        $livewire->emit('refresh');
                    })


That "recordId" is the id of the product that was attached via the relationship. However, is there a way to access the pivot table information? Let's say I have a pivot table named "order_products", every time I "attach" a product to an order, there's a new entry on that table.

Is there like an event that is emitted as described in the Form Builder documentation? Or maybe in the livewire object that I use in the callback? Where do I found that recently created row in the pivot table?
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

RelationManager select relationship with multiple(), Duplicate entry on update
FilamentFFilament / ❓┊help
2y ago
Get current model inside relationManager
FilamentFFilament / ❓┊help
2y ago
How to refresh a relationManager after Action on Owner.
FilamentFFilament / ❓┊help
2y ago
How to get the form data in a RelationManager create or edit action?
FilamentFFilament / ❓┊help
10mo ago