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

Cloudflare Api Laravel Package

graham-campbell/cloudflare-api

A Laravel/PHP client for the Cloudflare API, providing a simple, expressive wrapper for managing zones, DNS records, caching, and other Cloudflare resources through a clean, framework-friendly interface.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • This is a thin Laravel service-provider wrapper around Cloudflare's PHP SDK, not an integration platform. It contributes a config file, a manager (built on graham-campbell/manager), a facade, and named-connection resolution — everything below that is Cloudflare's own SDK. Framing it correctly shrinks the decision from "adopt a vendor" to "do we call the Cloudflare API from our app, and at what abstraction level."
  • Fit is confined to the legacy service-container + facade pattern and manual provider/alias registration in config/app.php — i.e., Laravel 5.0 through 5.4. Auto-discovery (5.5+) and anything modern are out of scope.
  • The one genuinely reusable architectural idea is multi-connection: CloudFlareApi::connection('production') vs 'staging' lets one app hold separate credential sets. That pattern is worth carrying into whatever replaces it.

Integration feasibility

  • Mechanically trivial: exact version pin, provider + alias registration, vendor:publish, two env vars. 1–2 engineer-days, most of it staging credential verification and dependency-conflict resolution, not code.
  • Feasibility is gated less by the package than by its dependency chain: minimum-stability: alpha bleeding into the whole Composer graph, PHP 7 / Guzzle 6 assumptions, and expected Guzzle 7 conflicts if anything else in the app is modern.
  • Verdict: feasible only as a maintenance task inside an already-Laravel-5 application. There is no greenfield path.

Technical risk

  • Deprecation is explicit, not inferred. The repository lives under a GrahamDeprecated namespace, with 0 stars, 0 dependents, score 0.3, and a final 0.7.0-alpha whose headline change is "upgraded to Laravel 5.0." That is a maintainer stating retirement.
  • Legacy auth is the blocker. The config ships email + key, producing global X-Auth-Email/X-Auth-Key headers. There is no evidence of scoped API Token (Authorization: Bearer) support. Practically: one leaked env var can rewrite DNS for every zone on the account. Most security postures today reject that outright.
  • No CVE process, no patch releases, no escalation target. The residual risk isn't the code quality — it's that the package silently stays in the deploy path for years.
  • Alpha-semver breaking change in a minor bump (providers→repositories, no shims) is evidence the project never reached an API-stability contract. "Just pin it" is the only safe consumption mode available.
  • Silent-failure surfaces are baked in: Cloudflare returns success: false with HTTP 200, pagination is not automatic, and zone activation is asynchronous.

Key questions

  • Do we already consume this, and at which version? Any 0.6.x install must be grepped for Provider class references before any composer update — that rename is a blocking migration item.
  • Does our security posture require scoped API tokens now or within twelve months? If yes, this is a hard stop, not a patch.
  • What is the blast radius: internal tooling, or the customer-facing DNS/SSL path that keeps sites online?
  • Who owns it internally, and what is the recorded removal date?
  • Is the requirement "Cloudflare automation" (real roadmap need) or "this package" (incidental)? The first is a one-day adapter; the second is a fork-maintenance commitment.
  • What does a one-day spike against the official cloudflare/sdk actually show us?

Integration Approach

Stack fit

  • Laravel 5.0 only in practice; 5.5–5.8 need shimming, 6+ is unsupported. PHP 7-era runtime with Guzzle 6 — PHP 8 hosts will fight it.
  • It implicitly commits the org to app-owned Cloudflare config. If infrastructure direction is Terraform/IaC, this package is a contradiction, not a convenience. That is an architecture decision to make explicitly, not by default.

Migration path

  • If inheriting 0.6.x: the providers→repositories rename requires a config republish plus namespace rewrite, with no deprecation shim. Treat it as a blocking work item, not a footnote.
  • The recommended path is not to migrate to it — to migrate off it. Target official cloudflare/sdk behind a thin internal adapter (e.g. CloudflareDnsService, CloudflareZoneService) so domain logic never couples to SDK method signatures.
  • Sequence: (1) inventory current usage and version, (2) introduce a seam in front of the manager, (3) swap the implementation behind that seam, (4) delete the dependency from the graph.
  • Mine the package as reference documentation — endpoint mapping, config shape, request conventions. It is worth reading and worth excluding from the dependency review.

Compatibility

  • Pin exactly ("graham-campbell/cloudflare-api": "0.7.0-alpha") or vendor as a path repository; never let minimum-stability: alpha reach the whole graph. There are no patch releases coming to justify the flexibility.
  • Guzzle 7 coexistence needs an alias or a fork rebase — budget a day, not an hour, and put it on the critical path if it's discovered late.
  • config:cache swallows env changes, so key rotation requires a deploy step. That must reconcile with existing secret-rotation runbooks or it produces auth failures at the worst possible moment.
  • Do not scope roadmap items against this package: Workers, R2, Zero Trust/Access, Turnstile, Rulesets/Transform Rules, and scoped API tokens all postdate its active life.

Sequencing

  • Gate the decision on two things first: security review of token support, and blast-radius classification. Both can kill the option cheaply.
  • Run the one-day spike on the official SDK in parallel with the inventory. If it lands, the package conversation ends there and we've spent a day.
  • Only if the host app is genuinely pinned to Laravel 5.0, the need is narrow (zones/DNS/purge), and blast radius is internal, does "keep it, pin it, own it, set a removal date" get approved.
  • Custom-domain onboarding must not ship on this. That flow — create zone, poll status === 'active' with backoff, create proxied record, set SSL mode — needs a gated, retryable state machine. The state machine is the deliverable; the HTTP client is incidental.

Operational Impact

Maintenance

  • Zero upstream. No patches, no CVE response, no one to ask when Cloudflare changes a response shape. Requires a named internal owner and an entry in the dependency register with an explicit removal date.
  • The alpha pin is permanent friction on every future Composer update across the app.
  • Extension happens at the manager: bind additional \Cloudflare\API\Endpoints\* classes. Do not subclass the manager — nothing merges upstream.

Support

  • No vendor to escalate to; support load transfers entirely in-house. Budget for runbook authoring, not just for code.
  • Minimum runbook contents: config:cache after key rotation; check ->success rather than transport status; loop result_info for pagination; poll zone activation with backoff.
  • One-time staging diagnostic worth institutionalizing: log the client's headers (redacted) to distinguish "wrong credentials" from "wrong connection resolved."

Scaling

  • Throughput is a non-issue — it's a stateless thin client. The real scaling risk is organizational blast radius: every added tenant or connection multiplies exposure under a single global API key.
  • Multi-connection gives the illusion of isolation between prod, staging, and per-customer accounts while the legacy auth model undermines it. Don't let it substitute for real scoping.
  • Cache purge belongs in a queued job (ShouldQueue), never inline in a request a customer is waiting on.

Failure modes

  • Silent DNS write failure — Cloudflare returns success: false with HTTP 200; nothing throws.
  • Duplicate records from upsert logic that concludes "record doesn't exist" after reading only the default page.
  • Partial zone onboarding (zone created, record or SSL mode not) — needs retry-from-step, not retry-whole-flow.
  • Key rotation not picked up due to config cache — auth failures immediately after a security rotation.
  • Unparsed SDK drift after a Cloudflare API change: onboarding breaks, customers can't point domains, support absorbs it. One opt-in contract test against a scratch zone is the early warning system, and it must live outside the main suite.

Ramp-up

  • Technically low: any Laravel developer reads the facade, manager, and config in an afternoon.
  • Organizationally high: no community, no maintainer, no docs beyond the repository, and nobody on staff with prior exposure.
  • Stakeholder framing: roughly 1–2 engineer-days to build a ~150-line adapter over the officially supported, free SDK. The alternative cost is an unpatched component sitting in the path that keeps customer sites online. We are not rejecting Cloudflare automation — we are rejecting this specific artifact as its foundation.
  • The ask: approve the one-day spike against cloudflare/sdk for the custom-domain onboarding flow; treat graham-campbell/cloudflare-api as documentation only and exclude it from the dependency review.
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.
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator