Home > Net >  How to return json with http code instead redirect Laravel?
How to return json with http code instead redirect Laravel?

Time:10-17

I use enter image description here

CodePudding user response:

use following code :

return \response($data, $statusCode);

for example :

return \response(['name'=>'Amin'], 200);
  • Related