This is a laravel package for incoming webhook handling.
v0.1.0
Pending for documentation.
- Laravel 5.1+
-
In your composer.json, add the dependency:
"edgarnadal/inbounder": "dev-master"
-
Add the Inbounder service provider in your config/app.php:
Inbounder\InbounderServiceProvider::class,
- Add the following alias:
'Inbounder' => Inbounder\Facades\Inbounder::class,
- Create gateways:
php artisan vendor:publish --provider="Inbounder\InbounderServiceProvider"
Add your gateways like this on config/inbounder.php:
'gateways' => [
'example-gateway' => 'App\\Example\InbounderHandler'
]
Coming soon more on creating handlers.
post('/inbounder/{gateway}', function (\Request $request, $gateway) {
$gateway = \Inbounder::gateway($gateway, $request);
$parsed = $gateway->parse();
dd($parsed);
$handlerResponse = $parsed->handler()->run();
// Do something with your handler response, in this case
// I'll return it to the requester
return response()->json($handlerResponse);
// Or you could just return 200
return response()->make();
});