Esign Module

Webhooks Filament

The Esign module manages electronic signature templates, envelopes, provider callbacks, and signing completion events.

Location

src/Modules/Esign

Main Responsibilities

  • Store reusable signing templates.
  • Create and track signature envelopes.
  • Route provider webhook callbacks.
  • Mark related models complete when an envelope is signed.
  • Provide Filament resources for templates and envelopes.

Runtime Registration

EsignServiceProvider registers:

  • Config under the esign key.
  • Module migrations.
  • Module routes.
  • The EnvelopeSigned event listener.

The provider listens for EnvelopeSigned and sends it to UpdateModelStatusToCompleted.

Webhook Route

Provider callbacks are routed through:

modules/esign/{provider}/callback

The callback is handled by WebhookRouter, which delegates to the configured provider implementation.

Important Config

The main config file is:

src/Modules/Esign/config/esign.php

Important environment variables include:

ESIGN_DEFAULT_PROVIDER=signatureapi
SIGNATUREAPI_KEY=

Template storage is configured with the templates disk and path values in esign.php.

Key Classes

AreaClasses
ControllersWebhookRouter
ModelsTemplate, Envelope
ProvidersEsignBaseProvider, SignatureApiProvider
EventsEnvelopeSigned
ListenersUpdateModelStatusToCompleted
FilamentEsignPanelProvider, TemplateResource, EnvelopeResource
EnumsEnvelopeStatus

Operational Notes

When adding another signature provider, add the provider class under Providers, register it in config/esign.php, and route callbacks through the existing WebhookRouter path.