# WebhookClient class

The WebhookClient class triggers the processing of the middleware stack for a webhook via the sendWebhook() method.

For example:

use EonX\EasyWebhook\Interfaces\WebhookClientInterface;
use EonX\EasyWebhook\Webhook;

final class MyService
{
    /**
     * @var \EonX\EasyWebhook\Interfaces\WebhookClientInterface
     */
    private $webhookClient;

    public function __construct(WebhookClientInterface $webhookClient)
    {
        $this->webhookClient = $webhookClient;
    }

    public function send(): void
    {
        // Create simple webhook
        $webhook = Webhook::create('https://eonx.com/webhook', ['event' => 'showcase'], 'PUT');

        // Send the webhook
        $this->webhookClient->sendWebhook($webhook);
    }
}