PHPackages                             milcomp/cloudflare-d1-database - 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. [Database &amp; ORM](/categories/database)
4. /
5. milcomp/cloudflare-d1-database

ActiveLibrary[Database &amp; ORM](/categories/database)

milcomp/cloudflare-d1-database
==============================

Easy configuration and setup for D1 Database connections in Laravel.

v1.1.7(1y ago)3157MITPHPPHP ^8.2

Since Oct 16Pushed 1y agoCompare

[ Source](https://github.com/milcomp/cloudflare-d1-database)[ Packagist](https://packagist.org/packages/milcomp/cloudflare-d1-database)[ Docs](https://github.com/TanDuy03/cloudflare-d1-database)[ GitHub Sponsors](https://github.com/TanDuy03)[ RSS](/packages/milcomp-cloudflare-d1-database/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (11)Versions (20)Used By (0)

D1 - Cloudflare bindings for Laravel
====================================

[](#d1---cloudflare-bindings-for-laravel)

[![StyleCI](https://camo.githubusercontent.com/3bb435af1825e65a22fc7ed19337a9474b9cb5045f4736d90609cedacf4d3e54/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3834353439313330372f736869656c643f6272616e63683d6d61696e)](https://github.styleci.io/repos/845491307)[![Packagist Dependency Version](https://camo.githubusercontent.com/b0b6ccb7a4cf19ebf5ff035a9f5bd0c224da866d72faf4163483470f7b2a2942/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6e74616e6475792f636c6f7564666c6172652d64312d64617461626173652f706870)](https://camo.githubusercontent.com/b0b6ccb7a4cf19ebf5ff035a9f5bd0c224da866d72faf4163483470f7b2a2942/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6e74616e6475792f636c6f7564666c6172652d64312d64617461626173652f706870)[![Latest Stable Version](https://camo.githubusercontent.com/d628514d150e0d04ac534664ba47e5de5f6ab157d94bd1372c2b9a38d4c742e4/68747470733a2f2f706f7365722e707567782e6f72672f6e74616e6475792f636c6f7564666c6172652d64312d64617461626173652f762f737461626c65)](https://packagist.org/packages/ntanduy/cloudflare-d1-database)[![Total Downloads](https://camo.githubusercontent.com/05001ba41a834f8b20846c8d371ffda237a6c7afdf6cff5c50a202b126c8059e/68747470733a2f2f706f7365722e707567782e6f72672f6e74616e6475792f636c6f7564666c6172652d64312d64617461626173652f646f776e6c6f616473)](https://packagist.org/packages/ntanduy/cloudflare-d1-database)[![Monthly Downloads](https://camo.githubusercontent.com/02987b299cb6c9466843887b4c519c5ab2c2583fcfdd531eccf618fa51e26607/68747470733a2f2f706f7365722e707567782e6f72672f6e74616e6475792f636c6f7564666c6172652d64312d64617461626173652f642f6d6f6e74686c79)](https://packagist.org/packages/ntanduy/cloudflare-d1-database)[![License](https://camo.githubusercontent.com/b40ca42b8d6f352d6887276e2dfc79099a4516ef3c1ac067bb9769352b7cbd66/68747470733a2f2f706f7365722e707567782e6f72672f6e74616e6475792f636c6f7564666c6172652d64312d64617461626173652f6c6963656e7365)](https://packagist.org/packages/ntanduy/cloudflare-d1-database)

Integrate Cloudflare bindings into your PHP/Laravel application.

This package offers support for:

- [Cloudflare D1](https://developers.cloudflare.com/d1)

🚀 Installation
--------------

[](#-installation)

```
composer require milcomp/cloudflare-d1-database
```

👏 Usage
-------

[](#-usage)

### Integrate Cloudflare D1 with Laravel

[](#integrate-cloudflare-d1-with-laravel)

Add a new connection in your `config/database.php` file:

```
'connections' => [
    'd1' => [
        'driver' => 'd1',
        'prefix' => '',
        'database' => env('CLOUDFLARE_D1_DATABASE_ID', ''),
        'api' => 'https://api.cloudflare.com/client/v4',
        'auth' => [
            'token' => env('CLOUDFLARE_TOKEN', ''),
            'account_id' => env('CLOUDFLARE_ACCOUNT_ID', ''),
        ],
    ],
]
```

Next, configure your Cloudflare credentials in the `.env` file:

```
CLOUDFLARE_TOKEN=
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_D1_DATABASE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

```

The `d1` driver will forward PDO queries to the Cloudflare D1 API to execute them.

🌱 Testing
---------

[](#-testing)

Start the built-in Worker to simulate the Cloudflare API:

```
cd tests/worker
npm ci
npm run start
```

In a separate terminal, run the tests:

```
vendor/bin/phpunit
```

🤝 Contributing
--------------

[](#-contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance42

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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

Every ~5 days

Recently: every ~0 days

Total

19

Last Release

481d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/06223548083051afe845f9a7dc2359fd0024bb91a265db9901c624a706bdd6d0?d=identicon)[floodx92](/maintainers/floodx92)

---

Top Contributors

[![floodx92](https://avatars.githubusercontent.com/u/47539249?v=4)](https://github.com/floodx92 "floodx92 (24 commits)")[![TanDuy03](https://avatars.githubusercontent.com/u/95908945?v=4)](https://github.com/TanDuy03 "TanDuy03 (2 commits)")

---

Tags

laraveldatabasecloudflared1TanDuy03

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/milcomp-cloudflare-d1-database/health.svg)

```
[![Health](https://phpackages.com/badges/milcomp-cloudflare-d1-database/health.svg)](https://phpackages.com/packages/milcomp-cloudflare-d1-database)
```

###  Alternatives

[ntanduy/cloudflare-d1-database

Easy configuration and setup for D1 Database connections in Laravel.

215.4k](/packages/ntanduy-cloudflare-d1-database)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[renoki-co/l1

Laravel integration for Cloudflare Workers services.

16113.1k](/packages/renoki-co-l1)[silber/bouncer

Eloquent roles and abilities.

3.6k4.4M25](/packages/silber-bouncer)[jerome/filterable

Streamline dynamic Eloquent query filtering with seamless API request integration and advanced caching strategies.

19226.1k](/packages/jerome-filterable)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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