edgarnadal / inbounder
Handle inbound webhooks in organized way
dev-master
2016-12-26 13:47 UTC
Requires
- php: >=5.5.9
- illuminate/http: 5.1.*
- illuminate/support: 5.1.*
This package is not auto-updated.
Last update: 2024-12-17 05:07:27 UTC
README
This is a laravel package for incoming webhook handling.
Version
v0.1.0
Documentation
Pending for documentation.
Installation
Requirements
- Laravel 5.1+
Installing with Composer
-
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(); });