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 yesterday

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

33

—

LowBetter than 72% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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

528d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47539249?v=4)[Boncz Bálint](/maintainers/floodx92)[@floodx92](https://github.com/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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[ntanduy/cloudflare-d1-database

Cloudflare D1 database driver for Laravel — full Eloquent &amp; Query Builder support.

267.8k](/packages/ntanduy-cloudflare-d1-database)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[api-platform/laravel

API Platform support for Laravel

58170.8k14](/packages/api-platform-laravel)[renoki-co/l1

Laravel integration for Cloudflare Workers services.

16321.9k](/packages/renoki-co-l1)

PHPackages © 2026

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