Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camel-Case relationship in include? #1740

Open
endingman opened this issue Aug 12, 2020 · 1 comment
Open

Camel-Case relationship in include? #1740

endingman opened this issue Aug 12, 2020 · 1 comment

Comments

@endingman
Copy link

endingman commented Aug 12, 2020

I have relationship like this in model:
public function sampleItems(){ //code }

1:
protected $availableIncludes = ['sampleItems'];
when I use include for item it will return 'sampleItems'.
when I use include for collection or paginator it will return 'sample_items'.
why not the same return?
2:

when I use include for item ,I can use like this:
protected $availableIncludes = ['sample_items'];
And it will return 'sample_items'.

when I use include for collection or paginator,I can not use like this:
protected $availableIncludes = ['sample_items'];
And it will get an error.

So how can I use a relationship of Camel-Case in the right way when I use include?

@specialtactics
Copy link
Member

I am not sure tbh but I believe this is handled by League/Serealizer, not dingo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants