Return response()->json([
'name' => 'Abigail',
'state' => 'CA'
]);
Return response()
->json(['name' => 'Abigail', 'state' => 'CA'])
->withCallback($request->input('callback'));
If you would like to create a JSONP response, you may use the json method in combination with the withCallback method.