HasManyThrough - I can't get the main model's ID to load #48802
Unanswered
derianmarchan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel: 10
PHP: 8.1
HasManyThrough It doesn't load the ID of the model.
These are my models: Provider, ProviderProduct and QuotationMaterialProvider

This is my relationship:

It's logical that I want to reach the model QuotationMaterialProvider and load its data.
But the ID of the records isn't related to that model (QuotationMaterialProvider), but rather to the ProviderProduct apparently..
I was inspecting the data and the result is a combination of both Models/tables, but the ID of the main model doesn't load; an ID does appear, but it's from the intermediate model (ProviderProduct). Do I need to configure something additional?
LOAD DATA:


DATABASE ITEM

What should I do? Are the attributes being overwritten when the data is combined? I appreciate your help
Beta Was this translation helpful? Give feedback.
All reactions