trianity/laravel-mautic
A Laravel package that integrates Mautic marketing automation into your app, offering a config-driven wrapper for the Mautic API so you can manage contacts, segments, emails, forms, and campaigns from familiar Laravel code.
Architecture fit
mautic:diagnose, mautic:oauth:callback-url), and token persistence. v1.1.0 does not introduce migrations or token-storage changes, so it preserves the existing persistence model and APP_KEY dependency.OAuthBrowserAuthorizer that denies by default. This keeps the package out of the host application’s authentication and authorization boundary, which is the correct architectural posture for a TPM to endorse.Host header, and callbacks from superseded authorization attempts preserve the active session context. Both reduce exposure to host-header manipulation and multi-tab/retry flow breakage.Integration feasibility
oauth.routes block into config/mautic.php. This is a routine but error-prone step; teams that habitually run vendor:publish --force risk overwriting host configuration.Technical risk
app.url, with per-connection redirect_uri taking precedence. Behind load balancers, reverse proxies, or multi-domain deployments, an incorrect app.url or missing trusted-proxy configuration will produce callback mismatches that are difficult to diagnose from application logs alone.Location header change and session-context preservation are behavioral fixes; hosts with custom middleware that rewrites redirects should confirm no regression.Key questions
mautic:diagnose only, or through events/log channels suitable for alerting?oauth.routes settings safe to leave disabled in production while enabling them only in non-production environments for validation?Stack fit
mautic:oauth:callback-url command is a genuine integration aid — it lets platform and network teams agree on the exact redirect URI before registering the Mautic client, reducing a common class of setup failures.mautic:diagnose supports pre-flight checks without leaking secrets, which fits change-management and audit requirements.Migration path
APP_KEY rotation. Existing host-owned OAuth routes continue to work unchanged; this is effectively an additive release for those consumers.oauth.routes into config/mautic.php by hand, bind OAuthBrowserAuthorizer, configure the connection allowlist, then enable routes. Do not use vendor:publish --force.docs/oauth-host-adoption.md before removing superseded host OAuth infrastructure. Removal should be a separate, later change once the package-owned flow has been validated in production traffic.APP_KEY throughout.Compatibility
app.url deliberately and configure trusted proxies; per-connection redirect_uri overrides should be used where a single canonical URL cannot represent all entry points.Sequencing
oauth.routes configuration manually and confirm config caching behavior.mautic:diagnose and mautic:oauth:callback-url to validate credential resolution and the canonical redirect URI for each connection.Maintenance
config/mautic.php in sync with upstream oauth.routes defaults through manual merges rather than force-publishing.OAuthBrowserAuthorizer binding and the connection allowlist. These are small but security-critical artifacts that need code review and change control.Support
Scaling
app.url/redirect_uri resolution across nodes.Failure modes
app.url, missing trusted-proxy configuration, or a per-connection override conflict will break callbacks, typically only in production topology.config:cache combined with secrets supplied only at request time will yield missing or empty client secrets; the documented mitigation is process-environment injection plus worker restarts.Ramp-up
app.url per environment, trusted-proxy configuration confirmed, shared session store decision made, and secret injection path agreed for FPM, CLI, scheduler, and workers.How can I help you explore Laravel packages today?