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

[5.6] ResourceResponse returns the resource data instead of JSON on Original #22455

Merged
merged 3 commits into from
Dec 18, 2017
Merged

[5.6] ResourceResponse returns the resource data instead of JSON on Original #22455

merged 3 commits into from
Dec 18, 2017

Conversation

olivernybroe
Copy link
Contributor

By setting original to the model on resources, we can in our tests check directly if the model is the correct one, by just getting the original attribute on the response.
Often I don't want to check if the JSON is formatted correctly, just interested if the model is the correct one.

Pull request send to master instead of 5.5, as commented in #22429

@olivernybroe
Copy link
Contributor Author

The reason for setting the original before withResponse is run, is for the ability to still change original in your withResponse function.
So withResponse is always the last thing that touches the response object.

@taylorotwell taylorotwell merged commit 0b4061e into laravel:master Dec 18, 2017
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

Successfully merging this pull request may close these issues.

2 participants