D
D
DTX2017-02-22 13:12:15
Laravel
DTX, 2017-02-22 13:12:15

How to allow Cyrillic output on the page when returning json?

I return json like this:
return response()->json($res);
I get:
Et0PqHH.png
At the same time, Cyrillic is visible in DevTools.
How can I make them visible on the page itself?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Skogorev, 2017-02-22
@DirecTwiX

$options = app('request')->header('accept-charset') == 'utf-8' ? JSON_UNESCAPED_UNICODE : null;

return response()->json($data, 200, $options);

O
ololo pishpish, 2017-10-30
@ololopishpishrealne

Web services from root do not run for security reasons.
The unit explicitly specifies the user to run as.
What is the problem?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question