How does laravel response return json data and status code at the same time?
PHP中文网
PHP中文网 2017-05-16 16:48:26
0
1
607

Return a json prompt

['code' => 'Verification code error! ']

Then return a status code with a response header of 422

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
过去多啦不再A梦

return response()->json(['code' => '验证码错误!'],422)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template