Closed
Description
As per this issue:
cloudcreativity/laravel-json-api#264
The controller hooks for modifying a relation should receive the relation value. We can use the LazyRelation
value here, just like the authorizers.
The LazyRelation
class actually caches its value internally for a to-many relation. We should add caching of the to-one relation as well. Then we should keep the instance on the request, so that the same instance is used for both the authorization and the controller hooks: meaning there would only be one database request if the relation is accessed in both the authorization code and the controller hook.
Metadata
Metadata
Assignees
Labels
No labels