How to eager load in Relation Manager?
Hey guys, I am trying to optimise my app. So I used this:
Model::shouldBeStrict(app()->isLocal());
I found one problem in my RelationManager. I have User that has many Clients and he belongs to Address. When I want to edit User I got this error:
https://flareapp.io/share/dPbNO6LP#F129Flare
Attempted to lazy load [address] on model [App\Models\Client] but lazy loading is disabled. - The error occurred at http://leasing.test/users/6/edit
2 Replies
override
getTableQuery()
and return parent::getTableQuery()->with('address')
Thanks Dan, I couldn't find the method that was responsible for the query.