-
PHP supports several options on how to encode JSON - some of the most important ones for APIs could be
framework/src/Illuminate/Http/Resources/Json/JsonResource.php Lines 214 to 223 in 6e9baa0
framework/src/Illuminate/Http/Resources/Json/ResourceResponse.php Lines 29 to 49 in 6e9baa0 Idea 1 - new method to define options Idea 2 - resolve In theory that is also a bigger "problem" as it could also be helpful to define application-wide encoding options used by default instead of |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
The second part of your Idea 2 would be fantastic (some kind of global configuration option that sets the same JSON options throughout the application). I currently manually call |
Beta Was this translation helpful? Give feedback.
-
This would be a very cool addition for those, who use resource transformers as a platform for json response. |
Beta Was this translation helpful? Give feedback.
-
Don't we already have a method to set the encoding options in the API Resource? You can do it by adding the below method either in your API collection or resource class:
Thoughts, @Gummibeer @mikemand & @nope123nope ? |
Beta Was this translation helpful? Give feedback.
Don't we already have a method to set the encoding options in the API Resource?
You can do it by adding the below method either in your API collection or resource class:
Thoughts, @Gummibeer @mikemand & @nope123nope ?