I have two routes.
Route::get('/receiveSignal', ' SignalController@receiveSignal '); Route::get('/sendSignal', ' SignalController@sendSignal ');
I want to simulate sending data from sendSignal to the receive signal path.
So, in the signal sending function, I have the following:
public function sendSignal() { $data = ['spotid' => '421156', 'name' => 'Test', 'desc' => 'some desc', 'StartofDetection' => '2018-01-17 22:22:22']; $dataJson = json_encode($data); return $dataJson; }
How can I change it to receive in receiveSignal as follows:
public function receiveSignal() { $test = file_get_contents('php://input'); dd($test); }
Here I have to get json for receiveSignal after entering http: // localhost: 8000 / sendSignal . Is this even possible?
source share