📅  最后修改于: 2022-03-11 14:54:41.603000             🧑  作者: Mango
//In base controller
protected function jsonResponse($data, $code = 200)
{
return response()->json($data, $code,
['Content-Type' => 'application/json;charset=UTF-8', 'Charset' => 'utf-8'], JSON_UNESCAPED_UNICODE);
}
//In your controller
$this->jsonResponse($data);