Is there a way to customize JSON serialization
-
I have a model with some json columns. In my seeder, I got something like this:
When I look at the records inserted in the database (PostgreSQL), I see two problems.
Their values look like arrays
All unicode characters are escaped
Basically, it's using the json_encode() function under the hood with no options and I'd like to pass some options (JSON_FORCE_OBJECT and JSON_UNESCAPED_UNICODE) by default without having to explicitly write it every time.