Currently, Dingo tries to eagerload model based on the include keys in transformer, and uses the value as the resource key.
Expected Behaviour
It should be the other way round. The array key should be the resource key and the value should be used as the relationship name. This way, it won't affect the resource keys in the include query string.
Explanation
If would like to have something like this:
public $availableIncludes = ['billing_type' => 'billingType'];
instead of:
public $availableIncludes = ['billingType' => 'billing_type'];
in order to use a query string like myapiurl?include=billing_type
Comments
Is there a reason why it is implemented in the current way? Because I assume this is how it should have been thought about in the first place.
Note: After further testing, it seems this happens only with defaultIncludes? I'm confused, has this been implemented or is this manifestation part of fractal?
Actual Behaviour
Currently, Dingo tries to eagerload model based on the include keys in transformer, and uses the value as the resource key.
Expected Behaviour
It should be the other way round. The array key should be the resource key and the value should be used as the relationship name. This way, it won't affect the resource keys in the
include
query string.Explanation
If would like to have something like this:
public $availableIncludes = ['billing_type' => 'billingType'];
instead of:
public $availableIncludes = ['billingType' => 'billing_type'];
in order to use a query string like
myapiurl?include=billing_type
Comments
Is there a reason why it is implemented in the current way? Because I assume this is how it should have been thought about in the first place.
Note: After further testing, it seems this happens only with defaultIncludes? I'm confused, has this been implemented or is this manifestation part of fractal?