laravel-responder icon indicating copy to clipboard operation
laravel-responder copied to clipboard

Relationship not using custom resourcekey when loaded data

Open wukongrita opened this issue 6 years ago • 2 comments

Hi @flugger, this is an awesome project!

Btw; I have 2 models that related to each other with custom resourcekey, but I cannot have my custom resourcekey for the related model. What I've got is what I've define in the transformer ($load) as the resourcekey not the custom resourcekey that I already defined in getResourceKey() of the models.

Is there a way to use the getResourceKey() as the custom resourcekey on the relational ?

wukongrita avatar Aug 26 '19 04:08 wukongrita

Hi @wukongrita, thanks for the kind words. Do I understand you correctly in that you rather have the getResourceKey take precedence over the keys in the $load property?

flugg avatar Aug 27 '19 07:08 flugg

yes... or maybe there is a variable to set which keys that i would like to use? (either the getResourcekey or $load)

wukongrita avatar Sep 08 '19 00:09 wukongrita