F
Filament5mo 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 Kidd5mo ago
Do you have relationships defined in your models?
NikkiP
NikkiP5mo 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 Koch5mo ago
You shouldn't select ambigious columns. In that case don't select the ids of the joined tables
NikkiP
NikkiP5mo ago
So I should just select the needed column right? Then the table will use the id of the parent model?
Dennis Koch
Dennis Koch5mo ago
Yes. Currently SQL doesn't know which id to select
NikkiP
NikkiP5mo ago
Thank you @Dennis Koch!