Illuminate\Http\Resources\ConditionallyLoadsAttributes::whenLoaded takes the relationship string as a parameter. It should thus format as camelCase, not as snake_case, as can be observed on
It can be reproduced by having hasMany relationships to a model that has more than one word, e.g. SomeName, will create a someName()hasMany relation, but in the current pipe, the whenLoaded() will try and load some_name, which is incorrect.
Illuminate\Http\Resources\ConditionallyLoadsAttributes::whenLoaded
takes the relationship string as a parameter. It should thus format ascamelCase
, not assnake_case
, as can be observed onhttps://github.com/pipe-dream/laravel-file-factory/blob/fb24540b47bf7493907b925d1f7aef26d17b521b/src/pipes/APIResourcePipe.js#L37
It can be reproduced by having hasMany relationships to a model that has more than one word, e.g.
SomeName
, will create asomeName()
hasMany
relation, but in the current pipe, thewhenLoaded()
will try and loadsome_name
, which is incorrect.