I tried searching for solutions on how to return json response in laravel but after trying few variations i was lost on this matter, an explanations would be nice:
why is it that whenever i add a status codes in the json()
function like this
response()->json(['hello'=> $someErrors], 401)
I dont get the $someErrors
data in the console log of my js code
but when i remove it and do it like
response()->json($someErrors);
or
response($someErrors);
i get my $someErrors
data in the console log of my js code.
Thanks in advance!