Production-ready Laravel SDK for the Cloudflare API v4
ghostcompiler/laravel-cloudflare is a Laravel package for production-ready laravel sdk for the cloudflare api v4.
It currently has 1 GitHub stars and 0 downloads on Packagist (latest version v1.0.6).
Install it with composer require ghostcompiler/laravel-cloudflare.
Discover more Laravel packages by ghostcompiler
or browse all Laravel packages to compare alternatives.
Last updated
A premium, feature-rich PHP SDK and Laravel integration for the Cloudflare API v4, featuring rate-limit handling, automatic retries, and concurrent batch operations.
Retry-After response headers automatically.Install the package via Composer:
composer require ghostcompiler/laravel-cloudflare
Publish the configuration file:
php artisan vendor:publish --provider="Vendor\Cloudflare\Providers\CloudflareServiceProvider" --tag="config"
Add your Cloudflare credentials to your .env file:
CLOUDFLARE_TOKEN=your_api_token_here
# Or legacy email/key credentials
CLOUDFLARE_EMAIL=your_email_here
CLOUDFLARE_API_KEY=your_global_api_key_here
CLOUDFLARE_TIMEOUT=30
CLOUDFLARE_RETRIES=3
CLOUDFLARE_RETRY_BACKOFF=100
CLOUDFLARE_LOGGING_ENABLED=true
use Vendor\Cloudflare\Facades\Cloudflare;
$zones = Cloudflare::zones()
->filter(['status' => 'active'])
->perPage(50)
->page(1)
->get();
foreach ($zones as $zone) {
echo $zone->name . ': ' . $zone->status . "\n";
}
// Create a new record
$record = Cloudflare::dns()->create('zone_id_here', [
'type' => 'A',
'name' => 'subdomain',
'content' => '1.2.3.4',
'proxied' => true,
'ttl' => 1
]);
// Update the record
Cloudflare::dns()->update('zone_id_here', $record->id, [
'type' => 'A',
'name' => 'subdomain',
'content' => '5.6.7.8',
'proxied' => false,
'ttl' => 120
]);
// Delete the record
Cloudflare::dns()->delete('zone_id_here', $record->id);
Cloudflare::workers()->upload('account_id_here', 'my-script', 'console.log("Hello Worker");');
The MIT License (MIT). Please see License File for more information.
Built using ServBay