joesama / webhook
Guzzle Base HTTP Request Wrapper
4.1
2026-06-22 07:58 UTC
Requires
- php: ^8.3
- guzzlehttp/guzzle: ^7.12.1
- illuminate/support: v13.*|v12.*|v11.*|v10.*
- nesbot/carbon: ^3.13
Requires (Dev)
- orchestra/testbench: ^10.11
- pheromone/phpcs-security-audit: ^2.0.1
- phpstan/phpstan: ^2.2.2
README
HTTP Request Wrapper
Installation
Simple installation via composer :
composer require "joesama/webhook"
Usage/Examples
Define connector
If in need of pre-configured connector, a connector class can be created by extending Joesama\Webhook\Connectors\AbstractConnector class and implement
Joesama\Webhook\Connectors\ConnectorContract interface.
class ExamplesConnector extends AbstractConnector implements ConnectorContract
{
/**
* Define configuration parameter to be attach to request.
*/
public function webHookConfiguration(): array
{
return [];
}
/**
* Define request content to be send.
*/
public function webHookContent(): array
{
return [];
}
/**
* Define request header to attach to request.
*/
public function webHookHeader(): array
{
return [];
}
}
Initiate Request
To initiate a request can be simply by calling Joesama\Webhook\Web\Hook class and called the getResponse method.
$hook = new Hook();
$hook->setRequestBody([]);
$hook->getResponse('http://www.google.com', 'GET');
To use pre-configured connector, pass it as parameter to the Hook class
$connector = new ExamplesConnector();
$hook = new Hook($connector);
License
joesama/webhook is open-sourced software licensed under the MIT license.