Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sdk Laravel Package

cloudflare/sdk

A Laravel SDK for the Cloudflare API, making it easy to manage zones, DNS records, caches, and other Cloudflare resources straight from your PHP application with a clean, expressive, framework-friendly interface.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Multi-tenant custom domains. If the product lets customers point their own domain at a tenant, the SDK turns zone creation, DNS record writes, and SSL/TLS provisioning into a few method calls instead of a hand-rolled cURL layer. This directly unblocks a self-serve "connect your domain" flow that otherwise requires ops involvement per customer.
  • Deploy-time cache invalidation. Cache purge by URL, tag, or everything becomes a first-class step in the release pipeline — a concrete win for content freshness and a cheap way to fix "stale page after publish" bug reports without a support ticket.
  • Edge security as a product surface. WAF rules, firewall access rules, rate limits, and bot settings can be exposed as plan-tier features (e.g., "Advanced Protection" upsell) rather than manual dashboard work. Good input to pricing and packaging decisions.
  • Build vs. buy for the integration layer. The decision here is not "Cloudflare or not" — it's "write our own Cloudflare client, adopt this, or adopt Terraform." Adopting the SDK is the low-effort path: BSD-3-Clause, no copyleft exposure, and it removes an estimated few weeks of client code plus ongoing API-drift maintenance from the roadmap.
  • Roadmap sequencing signal. Because it covers the v4 API broadly (DNS, zones, Workers, R2, analytics, load balancers), it lets you prototype future features — edge functions, object storage, traffic analytics dashboards — without new vendor negotiation. Useful for validating demand before committing engineering.
  • Operational tooling. Bulk zone onboarding, DNS migration from a competitor, and audit/analytics pulls for internal dashboards all sit on the same client, which reduces the number of one-off scripts the team maintains.
  • Platform upgrade forcing function (2.0.0). The new major now requires PHP 8.1+ and accepts psr/http-message ^1.1 or ^2.0. That makes adopting it a small, concrete input to the "are we current on runtime versions" roadmap conversation — and in the common case where another dependency already pulled in PSR-7 v2, it removes a blocker rather than adding one.

When to Consider This Package

Adopt when most of these hold:

  • The backend is PHP 8.1+ on Laravel (practically Laravel 9 or newer; Laravel 10/11 if you want the well-trodden path) and already ships Guzzle 7 — the SDK is a thin, familiar layer with no new runtime dependency class. This is now a hard gate, not a preference: 2.0.0 drops PHP 7.2–8.0 entirely, so verify the runtime before the build-vs-buy debate starts.
  • Your dependency graph is otherwise clean on PSR-7. If a package in the tree already requires psr/http-message v2, 2.0.0 is the release that unblocks you; older 1.x lines would have forced a conflict-resolution detour.
  • You need more than one or two Cloudflare endpoints. Below that threshold a 40-line HTTP wrapper is cheaper to own than any dependency.
  • You want change-driven automation (per-tenant zones, per-deploy purges, rule sync) rather than one-time setup.
  • You are comfortable with vendor-specific API semantics leaking into your code — the SDK is a direct API mirror, not an abstraction, so treat it as an adapter behind your own interface.
  • License and maintenance posture matter and BSD-3-Clause with an active release cadence clears your legal/security review. The 2.0.0 work — PHP 8.4 deprecation fixes, CI across 8.1–8.4, refreshed tooling, removed committed lockfile — is reasonable evidence the maintainers are keeping pace with the ecosystem.

Look elsewhere when:

  • You are still on PHP 7.x or 8.0, or on a Laravel version pinned below the 8.1 baseline. There is no graceful path here: staying on the 1.x line means no PSR-7 v2 support and no 8.4 compatibility, so you are choosing a runtime upgrade or a frozen dependency. Price the PHP upgrade into the decision — it is usually the larger cost than the integration itself.
  • Infrastructure-as-code discipline is the requirement. If zones and DNS should be declarative, reviewed, and diffable, a Terraform/Pulumi provider is the better tool and the SDK becomes a runtime-only helper.
  • Adoption signal is thin. The low dependent count and modest star count mean fewer battle-tested edge cases and a smaller pool of answers when something breaks; budget for reading Cloudflare's API docs directly.
  • You only need cache purge or a health check. A minimal internal client avoids a dependency you'll have to version-pin.
  • You need strict API stability guarantees. An API-mirroring client tracks upstream changes; 2.0.0 is itself proof that majors can land with breaking runtime requirements. Pin versions and wrap it.
  • Non-PHP services or edge-runtime code. Wrong tool entirely.
  • You require vendor support contracts. Community-maintained bindings won't come with an SLA — that has to come from Cloudflare directly.

How to Pitch It (Stakeholders)

For executives: This is a small, permissively licensed PHP client for Cloudflare's API that lets us automate the edge network we already pay for. The business case is speed and cost avoidance: it shortens the path to self-serve custom domains (a recurring enterprise ask), removes a class of manual ops work from DNS and SSL provisioning, and eliminates weeks of custom integration code we would otherwise build and maintain. The new 2.0.0 release is a maintenance release with one breaking change — it requires PHP 8.1 or newer — so the only real prerequisite is confirming our runtime is current; if it is, this is a clean upgrade, and if it isn't, the PHP upgrade is worth doing on its own merits and is the larger line item either way. Risk is contained — it's a client library, not a platform commitment, and swapping it out later is a contained refactor if we keep it behind our own interface.

For engineering: It's a Guzzle 7-based, BSD-3-Clause wrapper over the Cloudflare v4 API with broad endpoint coverage. Version 2.0.0 drops PHP < 8.1, adds psr/http-message ^1.1 || ^2.0 (which resolves conflicts with libraries on PSR-7 v2), fixes PHP 8.4 implicit-nullable deprecations, bumps Guzzle to ^7.4, and moves CI to test PHP 8.1–8.4 with refreshed PHPUnit and php-cs-fixer. Practically that means: check composer why-not cloudflare/sdk 2.0.0 before planning the work, and treat this as the version to pin. It saves us writing and maintaining HTTP plumbing, auth, and response handling, and it's easy to reason about because it mirrors the API rather than inventing abstractions. Two caveats to plan around: adoption is modest, so expect to lean on upstream docs for edge cases, and it is API-shaped, so we should wrap it in a narrow internal service (domain provisioning, cache purge, rule sync) and pin the version. That wrapper is the real decision — it keeps vendor specifics out of product code, it insulates us from the next major's runtime bumps, and it makes a future switch to Terraform or a hand-rolled client a one-file change.

Ask: approve a short spike (one sprint, one engineer) that first confirms our PHP/Laravel baseline against the 8.1 floor, then wraps the client behind an internal interface and validates the custom-domain and cache-purge flows against a staging zone — enough evidence to commit or walk away cheaply.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console