Make sure you exclude the url from csrf
Sep 9, 2020
7
Level 2
How to receive POST from other site
POST request comes from another site to the page /callback Need to receive it, save data and send status 200 back.
View is not needed Tried to do it in routes, for sample:
use Illuminate\Http\Request;
Route::get('/callback', function (Request $request) {
$request = request()->post();
Log::info($request);
return response('', 200); });
if we specify the $request = '123', then the log is written
[2020-09-09 04:25:12] local.INFO: 123
otherwise the log is empty
What am I doing wrong?
Level 102
Did you remember to change the route to expect a post request?
Route::post('/callback', function (Request $request) {
$request = request()->post();
Log::info($request);
return response('', 200);
});
Please or to participate in this conversation.