error handling through json in laravel code example
Example: laravel json response with error code
return Response::json([
'hello' => $value
], 201); // Status code here
return Response::json([
'hello' => $value
], 201); // Status code here