Frontend relations are declared as calls, not as property definitions. Getting this wrong produces undefined at render time with no console error, which reads as an API problem rather than a model problem.
Right
Thing.prototype.owner = Model.hasOne<User>('owner');
Thing.prototype.items = Model.hasMany<Item>('items');
Then thing.owner() — called, not read.
Eager loading is endpoint-level
eagerLoad is declared on the endpoint, not on the field. Putting it on the field silently loads nothing and you get an N+1 query pattern that only shows up under load:
Endpoint\Show::make()
->eagerLoad(['owner', 'items']),
For relations resolved by a getter rather than a real Eloquent relationship, batch them yourself — there is nothing for eagerLoad to hook into.
Recommended Comments