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#F129
Flare
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
Dan Harrin
Dan Harrin2y ago
override getTableQuery() and return parent::getTableQuery()->with('address')
Trauma Zombie
Trauma ZombieOP2y ago
Thanks Dan, I couldn't find the method that was responsible for the query.
Want results from more Discord servers?
Add your server