Closed Feniksss closed 6 years ago
Laravel version?
5.3
I am having the same issue on 5.3. I also do not see any logic in the code to handle 'eav' relationship loading.
It's located in the scope class. Probably needs a few changes to work with 5.3. This was tested up to 5.2.
On Tue, 6 Dec 2016 at 01:21, brenjt notifications@github.com wrote:
I am having the same issue on 5.3. I also do not see any logic in the code to handle 'eav' relationship loading.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/IsraelOrtuno/Eavquent/issues/47#issuecomment-265022096, or mute the thread https://github.com/notifications/unsubscribe-auth/ABr_yWB9GP1kOj9DEhKeh457fJaM_Ilnks5rFKqfgaJpZM4K9GC_ .
The issue seems to be here: $eagerLoads = array_merge($eagerLoads, $model->getAttributeRelations());
getAttributeRelations()
is returning an empty array when booting. But when called after boot it returns the correct data.
I found the problem for me at-least. It had to do with inheritance. If i was overwriting the newFromBuilder and wanted to load a dynamic class instance for my model then the scopes would never be applied resulting in it never loading those relationships.
I think this could be easily resolved if the ->load('eav')
worked correctly. I'll see if I can find a solution.
Hi. I try to load a fields by:
And I get an error:
Call to undefined relationship [eav] on model [App\Test].
But if I use the construction 'with' in model:
protected $with = ['eav'];
- It's works correct. So, what's the problem? Thanks!