send response as json in laravel code example
Example 1: php laravel return json response
return response()->json([
'name' => 'Abigail',
'state' => 'CA'
]);
Example 2: laravel return response view
return response()->view('your_view', compact('variableName'));