joesama/webhook

Guzzle Base HTTP Request Wrapper

Maintainers

Package info

github.com/joesama/webhook

pkg:composer/joesama/webhook

Transparency log

Statistics

Installs: 972

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

4.1 2026-06-22 07:58 UTC

This package is auto-updated.

Last update: 2026-07-22 08:06:52 UTC


README

HTTP Request Wrapper

Webhook Installation Validation Scrutinizer Code Quality Code Coverage Build PHPStan

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.