PHPackages                             renoki-co/l1 - 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. renoki-co/l1

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

renoki-co/l1
============

Laravel integration for Cloudflare Workers services.

0.1.0(2y ago)16325.0k↓70.8%35[7 PRs](https://github.com/renoki-co/l1/pulls)Apache-2.0PHPCI passing

Since Oct 2Pushed 6mo ago4 watchersCompare

[ Source](https://github.com/renoki-co/l1)[ Packagist](https://packagist.org/packages/renoki-co/l1)[ Docs](https://github.com/renoki-co/l1)[ GitHub Sponsors](https://github.com/rennokki)[ RSS](/packages/renoki-co-l1/feed)WikiDiscussions master Synced 2w ago

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

L1 - Cloudflare bindings for Laravel
====================================

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

[![CI](https://github.com/renoki-co/l1/workflows/CI/badge.svg?branch=master)](https://github.com/renoki-co/l1/workflows/CI/badge.svg?branch=master)[![codecov](https://camo.githubusercontent.com/41b498fe5809c5b8a7e7d58570479f0b55a9e81c455dc7868014e305810eb658/68747470733a2f2f636f6465636f762e696f2f67682f72656e6f6b692d636f2f6c312f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/renoki-co/l1/branch/master)[![StyleCI](https://camo.githubusercontent.com/511259231e80790714e2d098d7db5946a3030bb9c30ba5320d6d28319afc36a4/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3635313230323230382f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/651202208)[![Latest Stable Version](https://camo.githubusercontent.com/708fa93241ac44c4781f37d73a555822e12edfab34f669d1c37e8f9b7d0795ca/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c312f762f737461626c65)](https://packagist.org/packages/renoki-co/l1)[![Total Downloads](https://camo.githubusercontent.com/0aee8d2406061d153aeb3144a559e8020c11211f1dee765071277a9a5c1f1dc3/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c312f646f776e6c6f616473)](https://packagist.org/packages/renoki-co/l1)[![Monthly Downloads](https://camo.githubusercontent.com/fb8f89bb4adcf129845bc1eabd0965c94b599f28d11c0d146c3e293fb5dbce16/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c312f642f6d6f6e74686c79)](https://packagist.org/packages/renoki-co/l1)[![License](https://camo.githubusercontent.com/7347bf81dc45ce286f1e74441e7fcbd3f61152ad289807caf5f200188335930b/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c312f6c6963656e7365)](https://packagist.org/packages/renoki-co/l1)

Extend your PHP/Laravel application with Cloudflare bindings.

This package offers support for:

- [Cloudflare D1](https://developers.cloudflare.com/d1)
- [Cloudflare KV](https://developers.cloudflare.com/kv/)
- [Cloudflare Queues](https://developers.cloudflare.com/queues)

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

[](#-installation)

You can install the package via Composer:

```
composer require renoki-co/l1
```

🙌 Usage
-------

[](#-usage)

### D1 with raw PDO

[](#d1-with-raw-pdo)

Though D1 is not connectable via SQL protocols, it can be used as a PDO driver via the package connector. This proxies the query and bindings to the D1's `/query` endpoint in the Cloudflare API.

```
use RenokiCo\L1\D1\D1Pdo;
use RenokiCo\L1\D1\D1PdoStatement;
use RenokiCo\L1\CloudflareD1Connector;

$pdo = new D1Pdo(
    dsn: 'sqlite::memory:', // irrelevant
    connector: new CloudflareD1Connector(
        database: 'your_database_id',
        token: 'your_api_token',
        accountId: 'your_cf_account_id',
    ),
);
```

### D1 with Laravel

[](#d1-with-laravel)

In your `config/database.php` file, add a new connection:

```
'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', ''),
        ],
    ],
]
```

Then in your `.env` file, set up your Cloudflare credentials:

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

```

The `d1` driver will proxy the PDO queries to the Cloudflare D1 API to run queries.

🐛 Testing
---------

[](#-testing)

Start the built-in Worker that simulates 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.

🔒 Security
----------

[](#--security)

If you discover any security related issues, please email  instead of using the issue tracker.

🎉 Credits
---------

[](#-credits)

- [Alex Renoki](https://github.com/rennokki)
- [All Contributors](../../contributors)

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance46

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

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

1051d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21983456?v=4)[rennokki](/maintainers/rennokki)[@rennokki](https://github.com/rennokki)

---

Top Contributors

[![rennokki](https://avatars.githubusercontent.com/u/21983456?v=4)](https://github.com/rennokki "rennokki (6 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

aicloudflarecloudflare-workersd1databasekvlaravelphpqueuesvectorizeworkersphplaraveldatabasesqlitequerycloudflareserverlesskvworkersr2d1serverless functionsserverless frameworkserverless architecture

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/renoki-co-l1/health.svg)

```
[![Health](https://phpackages.com/badges/renoki-co-l1/health.svg)](https://phpackages.com/packages/renoki-co-l1)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.9M110](/packages/mongodb-laravel-mongodb)[ntanduy/cloudflare-d1-database

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

278.2k](/packages/ntanduy-cloudflare-d1-database)

PHPackages © 2026

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