binary-cats/laravel-mailgun-webhooks
A Laravel package for receiving Mailgun webhooks: provides a webhook endpoint, verifies Mailgun signatures, and dispatches events for deliveries, opens, clicks, bounces, complaints, and unsubscribes so you can process email notifications cleanly.
Architecture fit. The package is a narrow, single-responsibility adapter: it exposes an HTTP endpoint, validates Mailgun's webhook signature, normalizes inbound event payloads, and hands them to the Laravel event dispatcher. That is a good architectural shape for a Laravel application because it keeps transport concerns (routing, signature verification, payload parsing) out of domain code and lets application logic subscribe to typed events. It composes cleanly with the framework's service provider, config publishing, and queue primitives rather than introducing a parallel abstraction. For teams already sending mail through Mailgun and running a Laravel monolith or modular monolith, the fit is high and the conceptual surface area is small.
Integration feasibility. Adoption is a standard Composer install plus config publish plus a webhook URL registered in the Mailgun dashboard. The real integration work is not the package — it is the surrounding decisions: where events are persisted, whether handlers are queued, how duplicates are suppressed, and how the signing key is distributed across environments. Because the package occupies only the ingress layer, feasibility is high but the package alone does not deliver a complete webhook pipeline; a TPM should scope the persistence, queueing, and observability workstreams explicitly rather than assuming "install package" equals "done."
Technical risk. The dominant risk is not code quality but project sustainability: 64 stars and a single small vendor (binary-cats) imply a low bus factor, limited community review, and no meaningful support contract. The most recent release is dated 2026-04-12, which suggests recent activity, but release cadence alone does not evidence a responsive maintainer. Secondary risks: coverage of Mailgun's full event taxonomy (delivered, permanent/temporary fail, opened, clicked, complained, unsubscribed, stored) may be partial; signature verification must match Mailgun's current HMAC scheme and handle the legacy-vs-current signing key distinction; and Laravel/PHP version support may lag framework majors. Idempotency, retry semantics, and malformed-payload behavior are the areas most likely to be under-specified in a package this size.
Key questions for the maintainer / spike.
Stack fit. Assumes a Laravel application on a supported PHP 8.x runtime with Composer-managed dependencies, and a Mailgun account already used for outbound mail. It sits alongside, not in conflict with, the Mailgun PHP SDK used for sending — the SDK handles outbound, this package handles inbound events. No new infrastructure is strictly required, though a queue backend (Redis/SQS/database) is strongly recommended to move event processing off the webhook request path.
Migration path. Best treated as an incremental replacement rather than a greenfield build. If a custom webhook controller already exists, stand up the package endpoint on a parallel route, point a Mailgun test webhook at it, and compare normalized output against the incumbent before cutting over subdomain-level webhook configuration. Because the package only owns ingress, existing listeners can be adapted by mapping current handler logic onto the package's dispatched events; the domain layer does not need to change. For greenfield, the sequence is straightforward and low-drama.
Compatibility considerations. Validate three things before committing: (1) the package's Laravel major-version constraint against the application's version, (2) PHP constraint alignment with the runtime, and (3) that the Mailgun signing key configuration matches the account's current webhook signing settings — a mismatch here produces silent 401/403 rejections that are easy to misdiagnose as an outage. Also confirm the package's route registration does not collide with existing middleware groups (CSRF exemption is typically required for webhook routes; verify it is handled or documented).
Sequencing.
composer.json.Maintenance. Low ongoing code maintenance if the application's event handling is thin — the package is small and MIT-licensed. The maintenance burden shifts to upgrade cadence: the package must track Laravel majors, and a lagging release can block framework upgrades. Budget for periodic verification that the package still supports the current Laravel release, and keep a fork-and-vendor contingency (the surface area is small enough to internalize in days if needed).
Support. Community-only: GitHub issues and README. No SLA, no vendor escalation path, no security advisory process beyond GitHub's. For a business-critical email event pipeline (bounce/complaint processing feeds suppression lists and compliance obligations), that support posture should be accepted consciously and mitigated with internal ownership of the integration.
Scaling. Webhook ingress volume is proportional to send volume — typically low relative to application traffic, but spiky after large campaign sends because Mailgun batches and retries. The package's request handling is cheap; the scaling lever is queue-backed asynchronous processing and batched persistence. Ensure the endpoint is excluded from unnecessary middleware (session, CSRF, heavy auth) and consider a dedicated worker pool for event consumers so campaign bursts do not starve transactional queues.
Failure modes to design for.
Ramp-up. A mid-level Laravel developer can integrate the package itself in under a day. The real ramp is domain knowledge: Mailgun's event taxonomy, retry/backoff behavior, the semantics of temporary vs. permanent failures, and how suppression and complaint events must feed downstream compliance processes. Plan roughly a sprint for a production-grade pipeline (ingress, verification, dedupe, queueing, observability, runbook) even though the package install is an afternoon. Document the runbook for "webhooks stopped arriving" and "verification failures spiked" before go-live.
How can I help you explore Laravel packages today?