You can pass this option. If we look at the source code for the JsonResponse class , you can pass json_encode parameters as the last parameter.
It will look something like this.
return Response::json($properties, 200, [], JSON_NUMERIC_CHECK);
Alternatively you can do this:
return Response::make( $properties->toJson(JSON_NUMERIC_CHECK), 200, ['Content-Type' => 'application/json'] );
Note: if $properties not an Elequoent model, then it should at least implement JsonableInterface
as well as :
return Response::make( json_encode($properties->toArray(), JSON_NUMERIC_CHECK), 200, ['Content-Type' => 'application/json'] );
Method
source share