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

Allow mixed payload for json_encode in MakesHttpRequests #54402

Closed
wants to merge 1 commit into from

Conversation

vdauchy
Copy link
Contributor

@vdauchy vdauchy commented Jan 29, 2025

Currently helpers:

  • postJson
  • putJson
  • patchJson
  • deleteJson
  • optionsJson

Only allow array to be passed as data which is annoying when using JsonSerializable DTOs.

This PR allows such code:

$this->postJson('https://exemple.com', new JsonSerializableDto(
    foo: 'foo',
));

@vdauchy vdauchy force-pushed the make-http-request-json-mixed branch from adbafd4 to 12a5fa9 Compare January 29, 2025 14:49
@taylorotwell
Copy link
Member

May be a breaking change to change these signatures on a patch release.

@vdauchy
Copy link
Contributor Author

vdauchy commented Jan 31, 2025

@taylorotwell Thanks for the review, I don't think this is a breaking change as it is a widening of input parameters.

Would this make sense to target the next laravel 12.x ?

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