themsaid/forge-sdk
A PHP SDK for the Laravel Forge API that lets you manage servers, sites, deployments, databases, and more programmatically from Laravel or PHP applications with a clean, expressive interface.
Package: laravel/forge-sdk — official Laravel SDK for the Forge API (server provisioning, site management, deployments, SSL, daemons, databases, backups).
Release under review: v4.1.1 (patch). Two changes: removal of Mockery from the test suite (dev-only, no runtime surface) and a data-integrity fix in CursorPaginator::lazy() that previously overwrote items across pages.
Architecture fit. The SDK is a thin, idiomatic client over Forge's REST API rather than an opinionated abstraction. It ships a service provider, facade, config file, and returns Illuminate-native types (collections, paginators), so it slots into a Laravel codebase with almost no architectural ceremony. It does not manage state, retries, or idempotency for you — the TPM should frame it as a transport layer, with our own service/repository classes owning provisioning workflows and deployment orchestration. It is a poor fit if we need multi-tenant abstractions over several infrastructure providers; it is a strong fit if Forge is already (or will be) our sanctioned provisioning control plane.
Integration feasibility. Low. Composer install, publish config, provide an API token via environment/secret store, and read-only calls are productive in a day. The lazy() fix is directly relevant to us: any inventory, cost-attribution, or compliance-reporting job that walks servers/sites page-by-page would have silently produced duplicated or dropped records prior to v4.1.1 — an error class that is hard to detect and expensive to reconcile after the fact.
Technical risk.
--no-dev.Key questions.
>=4.1.1 to guarantee the paginator fix?Stack fit. Native. Requires Composer and a Laravel application; no extra runtime services, queues, or extensions. Plays well with Laravel's HTTP client fakes in tests, which keeps our integration tests hermetic and cheap.
Migration path. Assume we currently call the Forge API via ad-hoc Http:: calls, a bespoke wrapper, or manual dashboard work. Sequence:
ForgeGateway service so call sites stay provider-agnostic.Compatibility. Pin the SDK with a caret constraint bounded to the current major and set a hard floor of ^4.1.1 for any code path using lazy(); lower bounds reintroduce the pagination defect. Validate the PHP/Laravel support matrix against our oldest supported application before rollout, and keep the test-only dependency change (Mockery removal) invisible to production images by verifying composer install --no-dev artifacts are unchanged in size and autoload.
Sequencing.
lazy() iteration — the exact path fixed in 4.1.1 — with assertion tests for page-boundary integrity.Maintenance. Low steady-state: watch the changelog, upgrade on patch cadence, and treat majors as planned work. The main ongoing cost is not the SDK but the inventory normalization layer and our version floor policy. Budget roughly a day per patch cycle for regression verification of read paths and paginated jobs.
Support. Backed by the Laravel organization and an active maintainer (recent commits include maintainer-authored changes), with public PR history and issue tracking. There is no commercial SLA — support is community-best-effort, so escalate-through-vendor is not an option. Forge's own support covers the platform, not the SDK, and our team owns the glue.
Scaling. Bounded by Forge API rate limits rather than our application. Mitigations: queue all write operations, cache inventory with a short TTL, prefer targeted single-resource fetches over full enumeration, and instrument call counts per token. The 4.1.1 paginator fix removes a correctness ceiling on large enumerations but does not change the throughput ceiling — plan for backoff on 429s from day one.
Failure modes.
Ramp-up. A Laravel-proficient engineer is productive in under a day on read paths and roughly a week to own deployment automation safely. Non-Laravel engineers should not own this integration. The real onboarding cost is Forge domain knowledge — token scoping, server/site lifecycle, and deploy semantics — not the SDK itself.
How can I help you explore Laravel packages today?