F
Filament11mo ago
NikkiP

How to get the record id of the table record when using a query with inner joins.

I'm planning to put an action button to my table but my table has query that is using inner joins. When I tried putting an edit/view action, it gets the base table of the resource. How to edit the custom records returned by the getEloquentQuery with inner join.
6 Replies
Brian Kidd
Brian Kidd11mo ago
Do you have relationships defined in your models?
NikkiP
NikkiPOP11mo ago
yes I do have relationship. But I think its only limited to 2 tables? I'm listing records by inner joining the other tables @Brian Kidd
Dennis Koch
Dennis Koch11mo ago
You shouldn't select ambigious columns. In that case don't select the ids of the joined tables
NikkiP
NikkiPOP11mo ago
So I should just select the needed column right? Then the table will use the id of the parent model?
Dennis Koch
Dennis Koch11mo ago
Yes. Currently SQL doesn't know which id to select
NikkiP
NikkiPOP11mo ago
Thank you @Dennis Koch!
Want results from more Discord servers?
Add your server