PHPackages                             kaffe-software/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. kaffe-software/l1

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

kaffe-software/l1
=================

Laravel integration for Cloudflare Workers services.

0.1.1(1y ago)093Apache-2.0PHP

Since Aug 14Pushed 1y agoCompare

[ Source](https://github.com/Kaffe-Software/l1)[ Packagist](https://packagist.org/packages/kaffe-software/l1)[ Docs](https://github.com/Kaffe-Software/l1)[ GitHub Sponsors](https://github.com/rennokki)[ RSS](/packages/kaffe-software-l1/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (2)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 kaffe-software/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

21

—

LowBetter than 18% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

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

641d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2361c1d343256fe00c196d1faa12a1154f35947b0531ee904847382947f61c35?d=identicon)[mucan54](/maintainers/mucan54)

---

Top Contributors

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

---

Tags

phplaraveldatabasesqlitequerycloudflareserverlesskvworkersr2d1serverless functionsserverless frameworkserverless architecture

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kaffe-software-l1/health.svg)

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

###  Alternatives

[renoki-co/l1

Laravel integration for Cloudflare Workers services.

16113.1k](/packages/renoki-co-l1)[ntanduy/cloudflare-d1-database

Easy configuration and setup for D1 Database connections in Laravel.

215.4k](/packages/ntanduy-cloudflare-d1-database)[bvanhoekelen/performance

PHP performance tool analyser your script on time, memory usage and db query. Support Laravel and Composer for web, web console and command line interfaces.

521774.3k4](/packages/bvanhoekelen-performance)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[helgesverre/milvus

PHP Client for the Milvus Rest API

306.2k](/packages/helgesverre-milvus)

PHPackages © 2026

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