Receive Webhook Requests
How to receive the webhook requests
Use the default route
You must enable inbox.uses_default_inbox_route
(set it to true)
Laravel Inbox Process ships the /inbox/{topic}
route for you, so basically you can use this route to register with your 3rd-party service.
To add a custom Request for your specific topic (eg: stripe
), first, you need to create a FormRequest and extend the AbstractInboxProcess
.
Additionally, if you want to transform a bit of the payload, you can override the AbstractInboxProcess@getInboxPayload
method.
From v1.1.1+: you can add authorize and rules method to validate the request.
Then register it to Inbox Process:
Lastly, if you wish to have a specific response for your services, you can use addResponse
Use your own route
Laravel Inbox Process ships the appendInboxMsg($topic, $uniqueId, $payload)
function for manual usage.
Simply invoke the function. The msg will be appended to the table and ready to be resolved under background work.
Note: if there is any duplicated message, the appendInboxMsg
will throw an Error.
If you need to know if duplicated record happens, check out the logic inside the InboxController.php
Last updated