I have simulator as you can see in the pictures. In this simulator I have a send button that will trigger sending a JSON string appended to a URL.
I test this with the URL localhost/ussd/index.php
The index.php page:
<?php
header('Content-type: application/json');
$inputJSON = file_get_contents('php://input');
$input= json_decode( $inputJSON, TRUE );
$data["message"]='We Display This in Phone Screen';
$data["applicationId"]=$input["applicationId"];
$data["password"]="password";
$data["version"]="1.0";
$data["sessionId"]=$input["sessionId"];
$data["ussdOperation"]="mt-cont";
$data["destinationAddress"]=$input["sourceAddress"];
$data["encoding"]="440";
$data["chargingAmount"]="5";
$json_string = json_encode($data);
$json_url = "http://localhost:7000/ussd/send";
$ch = curl_init( $json_url );
$options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array('Content-type: application/json') ,
CURLOPT_POSTFIELDS => $json_string
);
curl_setopt_array( $ch, $options );
$result = curl_exec($ch);
?>
Then index.php file gets this string and sends another string to that page. The simulator page gets this JSON object and displays it. This can be done in the index.php file.
But I want to do it in Laravel. I tried But not Work How can I do it.
It works like this:

request()->json()->all()is the way to extract json from request