定制 renoki-co/l1 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

renoki-co/l1

最新稳定版本:0.1.0

Composer 安装命令:

composer require renoki-co/l1

包简介

Laravel integration for Cloudflare Workers services.

README 文档

README

CI codecov StyleCI Latest Stable Version Total Downloads Monthly Downloads License

Extend your PHP/Laravel application with Cloudflare bindings.

This package offers support for:

???? Installation

You can install the package via Composer:

composer require renoki-co/l1

???? Usage

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

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

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

Please see CONTRIBUTING for details.

???? Security

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

???? Credits

统计信息

  • 总下载量: 5.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 158
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 158
  • Watchers: 4
  • Forks: 35
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固