juststeveking/laravel-envoyer-sdk
A Laravel SDK for the Envoyer deployment service, giving you a clean, fluent interface to manage projects, servers, deployments, and hooks from your app or artisan commands. Simplifies Envoyer API calls with typed requests and Laravel-friendly responses.
Architecture fit. This package is a thin, resource-oriented client over the Envoyer REST API — a service-layer dependency, not an architecture decision. A TPM should frame it narrowly: it enables a small, well-bounded set of features in Laravel apps that already deploy through Envoyer — an admin "Deploy now" control, a per-project release-status widget, deploy triggers from internal tooling or chat ops. It is architecturally worthless if Envoyer is not the deployment mechanism (Forge, Vapor, GitHub Actions, bespoke pipelines). The non-negotiable design-review requirement is that it sits behind an internal interface (e.g. an EnvoyerDeployer service) so neither the package nor the Envoyer API contract leaks into controllers or product code. That wrapper is the entire exit strategy; treat it as a delivery requirement, not a style preference.
Integration feasibility. Low-to-moderate engineering effort, higher verification effort. Composer install, service provider, publishable config, and an account API token get you to "authenticated." The real work is: enumerating the exact operations our use cases need (list projects/servers/environments, trigger deployment, poll status, hooks, collaborators), proving coverage, and exercising the whole path against a throwaway Envoyer project with a real token. Budget days, not weeks — but do not let anyone conflate "installed" with "validated." Explicitly socialize that a successful trigger response means the deployment was accepted, not completed; state modeling must be a status enum with terminal states, never a boolean.
Technical risk. Four items drive the risk picture, and each needs a named decision owner:
composer update — treat v2.0.0 as breaking until diffed against our call sites and smoke-tested.Risk acceptance boundary to state out loud: acceptable for low-criticality automation with an internal owner; not acceptable as an unmonitored path that production releases depend on.
Key questions to close before committing:
Stack fit. Good fit for PHP 8.x Laravel applications already on Envoyer that want deployment actions inside Laravel — an admin deploy button, a release-status dashboard, a trigger from an internal console or Slack command — all without distributing Envoyer UI access or account tokens to humans. Poor fit when CI/CD already owns deployments end-to-end, when we are not on Envoyer, or when requirements include approval gates, rollback policy, or audit trails beyond what Envoyer natively exposes. Those are platform builds and should be sized and staffed as such, not smuggled in as wrapper work.
Migration path. For existing v1.4.x users: branch, bump to ^2.0, resolve PHP/Laravel constraints, run the full suite, then smoke-test against a throwaway Envoyer project with a real token. For PHP 7.x estates: stay pinned to ^1.4 and sequence the runtime upgrade first — do not combine a PHP runtime upgrade and an SDK major upgrade in one release, or you lose failure attribution. For net-new adoption there is no migration; the decision is adopt-or-not, and the default pin is ^2.0 on PHP 8 with the version pinned explicitly in composer.json.
Compatibility checks. Laravel version constraints and framework major support; required PHP extensions; HTTP client (Saloon/Guzzle) alignment with the rest of the application — run composer why on the HTTP client after the upgrade; published config key names and base URL as actually shipped in the installed version (verify, do not assume ENVOYER_API_TOKEN); facade alias and container binding; method signatures versus our call sites; token permissions and endpoint behavior verified in staging before any production exposure.
Sequencing. Strictly ordered, one concern per release:
Do not pair the compatibility change with new deployment automation behavior. Keep them separate so failures are attributable to one change.
Maintenance. Low code footprint, but an external community dependency on a stalled cadence with a changelog too sparse to plan against. Pin the version explicitly, monitor advisories, and calendar a compatibility review at every Laravel and PHP upgrade. Carry a realistic line item for forking or vendoring if the package falls behind a framework major — the internal wrapper is what keeps that to days rather than weeks. Assign a named internal owner; unowned community dependencies are where these integrations quietly rot.
Support. No commercial SLA, no vendor backing, small contributor base. Document token generation, storage, rotation, and revocation; document config management; document the escalation path for a failed or stuck deployment. Community support is adequate for low-criticality automation (a manual deploy button, a dashboard) and inadequate for an unmonitored release path — set that expectation with stakeholders at approval time rather than during an incident. Deliver a short runbook covering token rotation, failed/stuck deployments, rollback, and the upgrade validation checklist.
Scaling. The SDK itself adds negligible overhead; the real constraints are Envoyer's rate limits, deployment concurrency, and network latency. Design rules to enforce in review: never make synchronous Envoyer calls in a user-facing request path — queue them; cache read-only data (project, server, collaborator lists) for a few minutes since it changes rarely and the API is rate-limited; resolve project and server IDs from config, never by name lookup at deploy time, which adds a round trip and fails silently on rename.
Failure modes. Envoyer API outage; expired or revoked token; rate limiting; network timeout; deployment triggered but failing, stuck, or never reaching a terminal state; double-deploy from a retried queue job after a timeout; config or facade misregistration; package incompatibility surfacing only after a framework upgrade. Mitigations to mandate: hard timeouts on every call, bounded retries, keeping deploy triggers out of automatically retried queue jobs, and Cache::lock() (or equivalent) guarding against double-deploys. Model status as an enum with explicit terminal states and a defined "how long before we call it stuck" threshold, because the operational failure people actually hit is not an error response — it's silence.
Ramp-up. Small. An engineer familiar with Laravel service providers and HTTP clients is productive in hours; the wrapper means only one or two people need to know the SDK at all. The ramp-up cost that matters is organizational, not technical: onboarding the on-call rotation onto the runbook and the token-rotation procedure, and making sure the person who owns the Envoyer account is identifiable before go-live.
How can I help you explore Laravel packages today?