-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Transformer not working for Collection responses #30
Comments
Regarding my last question about the key param "data". It seems to be hardcoded in League\Fractal|\Scope Line 110: 110 public function toArray()
111 {
112 $output = array(
113 'data' => $this->runAppropriateTransformer()
114 );
115 .. I'll file a bug report for that EDIT: My bad, it already on tracks thephpleague/fractal#45 |
Will look into it now. Cheers. 😄 |
Fixed and tagged in |
Thanks a lot @jasonlewis 😄 |
No worries. Hopefully soon the PR on Fractal will be right to go so we can use a custom serializer. |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I could be wrong but it seems that collections responses are not transformed by my Transformer. It do work for single Model returns :
Here is my code
returns for /api/me is correct (name parameter is correct) :
meanwhile return for /api/users is not correct
The "testTransformingCollectionUsingTransformerClassName" test from "TransformerTest.php" seems to ensure that it works.
Other question, why is the key param for single models "data" and not "user" as it should be?
The text was updated successfully, but these errors were encountered: