Download the PHP package foundry-co/cloudflare without Composer
On this page you can find all versions of the php package foundry-co/cloudflare. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download foundry-co/cloudflare
More information about foundry-co/cloudflare
Files in foundry-co/cloudflare
Package cloudflare
Short Description PHP SDK for the Cloudflare API, generated from the official OpenAPI spec
License MIT
Informations about the package cloudflare
Cloudflare PHP SDK
A PHP SDK for the Cloudflare API, auto-generated from the official OpenAPI spec. Uses Guzzle for HTTP and Valinor for typed response deserialization.
Requirements
- PHP 8.1+
- guzzlehttp/guzzle ^7.0
- cuyz/valinor ^2.0
Installation
Laravel
The package includes first-class Laravel support via a service provider and facade that are auto-discovered by Laravel's package auto-discovery.
Installation
Add the following to your .env:
That's it — the CloudflareServiceProvider is registered automatically and the Cloudflare facade is available immediately.
Publishing the config
This copies config/cloudflare.php into your application's config directory.
Usage
Authentication
All requests authenticate with a Cloudflare API Token. Create tokens in the Cloudflare dashboard under My Profile > API Tokens.
Working with Responses
Methods return typed PHP objects deserialized via Valinor. List endpoints that include pagination metadata return a PaginatedResponse:
Error Handling
The client throws CloudflareException on any non-2xx response. It is thrown automatically — you do not need to check the response yourself.
Resource Access
Resources are available directly from the client or scoped to a zone via zone().
Direct access (account-scoped or global resources)
Zone-scoped access
Pass a zone ID to zone() and then chain the resource:
Resources
Accounts
Account Members
DNS Records
DNS Settings
Zones
Rulesets
Cache
Workers
Workers KV
D1
R2
Pages
Stream
Cloudflare Images
Cloudflare Tunnels
Zero Trust / Access
Load Balancing
Logpush
Vectorize
AI Gateway
Workers AI
Hyperdrive
Queues
Radar
Notifications
Registrar
URL Scanner
Intelligence
Turnstile
User
Pagination
List endpoints that return result_info automatically return a PaginatedResponse. Iterate pages manually:
Testing
The CloudflareClient constructor accepts a custom HttpClient instance, which you can substitute in tests:
Code Generation
The SDK is auto-generated from the official Cloudflare OpenAPI spec. To regenerate:
License
MIT