vendredi 18 mai 2018

How to view data on laravel sent from external server

Scenario

Im getting a callback from a server except its not a callback technically its just a request sent from an external server, the send a post request to my server when they have completed the action i requested whether its in an hour or a day, so its more of a webhook.

I know you're supposed to get the data by using:

public function handleCallback(Request $request)
{
    $contents = $request->getContent();
}

But my problem is that i dont know how to view this data, usually id return it to a view or return it back from the ajax request that was made and i can view it in my web browser, but obviously because this request is coming from an external source i cant then return a view because its not a user making the request its a server, so it would return that data back to their server.

I know i can save this data to a file or to my database and view it there, but im wondering if theres a more clean way to view the data?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire