PHPackages                             villaflor/laravel-cloudflare - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. villaflor/laravel-cloudflare

ActiveLibrary[API Development](/categories/api)

villaflor/laravel-cloudflare
============================

A Laravel client library for accessing Cloudflare APIs

1.0.0(5y ago)269↓100%1BSD-3-ClausePHPPHP ^7.3|^8.0

Since Feb 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/villaflor/laravel-cloudflare)[ Packagist](https://packagist.org/packages/villaflor/laravel-cloudflare)[ Docs](https://github.com/villaflor/laravel-cloudflare)[ RSS](/packages/villaflor-laravel-cloudflare/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel Cloudflare
==================

[](#laravel-cloudflare)

Cloudflare library for Laravel. This library is an expansion of the official Cloudflare PHP SDK

 [ ![](https://camo.githubusercontent.com/9eaad8706e624f35d5ac0467d552aedb651633fdcc7f71b2307638d738d8dc61/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f76696c6c61666c6f722f6c61726176656c2d636c6f7564666c6172652e7376673f7374796c653d666c6174) ](https://travis-ci.org/github/villaflor/laravel-cloudflare) [ ![](https://camo.githubusercontent.com/ae935ae1cce328d7a77c0ae44ee3acb71aec0f7959b1f91e1fcca2b2ce2f553a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f76696c6c61666c6f722f6c61726176656c2d636c6f7564666c6172652e7376673f7374796c653d666c6174) ](https://github.com/villaflor/laravel-cloudflare/blob/main/LICENSE) [ ![](https://camo.githubusercontent.com/c3ca2cfa90960ba29c3c906a53c3efd6129db5740270a79cfcc6decd413523d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f76696c6c61666c6f722f6c61726176656c2d636c6f7564666c617265) ](https://travis-ci.org/github/villaflor/laravel-cloudflare) [ ![](https://camo.githubusercontent.com/a19f250ec1b80d10aa3c841a8b847e588b7e2d9372edff36bec9f536bac3b04c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76696c6c61666c6f722f6c61726176656c2d636c6f7564666c617265) ](https://packagist.org/packages/villaflor/laravel-cloudflare)

Requirement
-----------

[](#requirement)

- Cloudflare API token

Installation
------------

[](#installation)

In terminal

```
composer require villaflor/laravel-cloudflare

php artisan vendor:publish --provider="Villaflor\Cloudflare\CloudflareServiceProvider"
```

In .env file add this line

```
CLOUDFLARE_API_TOKEN={API token here}
```

Methods Available
-----------------

[](#methods-available)

### CloudflareDNS

[](#cloudflaredns)

- `addRecord`
- `listRecords`
- `getRecordDetails`
- `getRecordID`
- `updateRecordDetails`
- `deleteRecord`

### CloudflareDNSAnalytics

[](#cloudflarednsanalytics)

- `getReportTable`
- `getReportByTime`

### CloudflareIps

[](#cloudflareips)

- `listIPs`

### CloudflareZone

[](#cloudflarezone)

- `addZone`
- `activationCheck`
- `pause`
- `unpause`
- `getZoneById`
- `listZones`
- `getZoneID`
- `getAnalyticsDashboard`
- `changeDevelopmentMode`
- `getCachingLevel`
- `setCachingLevel`
- `cachePurgeEverything`
- `cachePurge`
- `deleteZone`

### CloudflareZoneLockdown

[](#cloudflarezonelockdown)

- `listLockdowns`
- `createLockdown`
- `getLockdownDetails`
- `updateLockdown`
- `deleteLockdown`

### CloudflareZoneSettings

[](#cloudflarezonesettings)

- `getMinifySetting`
- `getRocketLoaderSetting`
- `getAlwaysOnlineSetting`
- `getEmailObfuscationSetting`
- `getServerSideExcludeSetting`
- `getHotlinkProtectionSetting`
- `getBrowserCacheTtlSetting`
- `updateBrowserCacheTtlSetting`
- `updateMinifySetting`
- `updateRocketLoaderSetting`
- `updateAlwaysOnlineSetting`
- `updateEmailObfuscationSetting`
- `updateHotlinkProtectionSetting`
- `updateServerSideExcludeSetting`

Usage
-----

[](#usage)

This library uses Dependency injection. Dependency injection is a fancy phrase that essentially means this: class dependencies are "injected" into the class via the constructor or, in some cases, "setter" methods.

```
use Villaflor\Cloudflare\CloudflareDNS;

class MyClass
{
    private $cloudflareDNS;

    public function __construct(CloudflareDNS $cloudflareDNS)
    {
        $this->cloudflareDNS = $cloudflareDNS;
    }

    public function UpdateDNS()
    {
        $details = [
            'type' => 'A',
            'name' => 'my-domain.com',
            'content' => '1.2.3.4',
            'ttl' => 1,
            'proxied' => true,
        ];

        return $this->cloudflareDNS->updateRecordDetails('zone-id', 'record-id', $details);
    }

    public function DetailDNS()
    {
        return $this->cloudflareDNS->getRecordDetails('zone-id', 'record-id');
    }

    public function ListDNS()
    {
        return $this->cloudflareDNS->listRecords('zone-id');
    }
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1900d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/60b659450734f21a7a920500011a61a9996cb5112cf18a05bf8131916167e50a?d=identicon)[villaflor](/maintainers/villaflor)

---

Top Contributors

[![villaflor](https://avatars.githubusercontent.com/u/15763160?v=4)](https://github.com/villaflor "villaflor (23 commits)")

---

Tags

apilaravelcloudflarevillaflor

### Embed Badge

![Health badge](/badges/villaflor-laravel-cloudflare/health.svg)

```
[![Health](https://phpackages.com/badges/villaflor-laravel-cloudflare/health.svg)](https://phpackages.com/packages/villaflor-laravel-cloudflare)
```

###  Alternatives

[sebdesign/artisan-cloudflare

Laravel artisan commands for Cloudflare

77273.8k](/packages/sebdesign-artisan-cloudflare)[joshuapack/laravel-cloudflare

Use the Cloudflare API for Laravel 10-12 using PHP &gt;= 8.1.

122.0k](/packages/joshuapack-laravel-cloudflare)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
