Closed tonyv69 closed 2 years ago
Why would look like to change that? Do you want to select columns from an intermediate/pivot table?
The laravel_through_key
column is required for eager loading to work.
Thanks for the link and quick reply. I'll see if I can use that method to achieve what I want.
I want to use the id of the pivot table as the through key, and the id in the where clause as the parent model id the one that's normally used.
I'm trying to pass through two pivot tables to get to the data I need.
Did it work for you?
Hi, is it possible to use different id's for
laravel_through_key
andwhere
clause?example below (sql generated from hasManyDeep):
as you can see the above
id1
(first id in foreignKeys array inhasManyDeep()
) is used twice forlaravel_through_key
andwhere
clause.is it possible to use different id's?
Hope that make sense.
Thanks Tony