Ok, after some fishing around figured this out. Response::json accepts 4 parameters:
public static function json($data = array(), $status = 200, array $headers = array(), $options = 0)
So I changed my code to pass in the JSON_UNESCAPED_UNICODE option:
return Response::json(["partagés"],200,[], JSON_UNESCAPED_UNICODE);
Is there a better/more elegant way to do this? Seems a bit clunky...
Why are you afraid of escaped json? It will return to normal when you parse the string.
ah... I've been testing with a plain rest client that doesn't do any parsing... thought it was going to be annoying to deal with. just tested with something closer to the clients that will be consuming my data and all's good. Thanks for the response. no longer afraid ;)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community