adamrollinson / laravel-cloudflare-driver
Laravel integration for Cloudflare Workers services
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
pkg:composer/adamrollinson/laravel-cloudflare-driver
Requires
- php: ^8.2
- ext-pdo: *
- doctrine/dbal: ^4.2
- illuminate/cache: ^10.0||^11.0
- illuminate/console: ^10.0||^11.0
- illuminate/contracts: ^10.0||^11.0
- illuminate/database: ^10.0||^11.0
- saloonphp/saloon: ^3.10
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2025-10-13 13:46:59 UTC
README
Installation
You can install the package via composer:
composer require adamrollinson/laravel-cloudflare-driver
In your config/database.php file, add the following to the connections array:
'd1' => [ 'driver' => 'd1', 'prefix' => '', 'database' => env('CLOUDFLARE_D1_DATABASE_ID', ''), 'api' => env('CLOUDFLARE_D1_API', 'https://api.cloudflare.com/client/v4'), 'auth' => [ 'token' => env('CLOUDFLARE_TOKEN', ''), 'account_id' => env('CLOUDFLARE_ACCOUNT_ID', ''), ], ],
In your .env file, add the following:
CLOUDFLARE_TOKEN= CLOUDFLARE_ACCOUNT_ID= CLOUDFLARE_D1_DATABASE_ID=
Commands
php artisan d1:migrate
php artisan d1:migrate refresh
php artisan d1:migrate reset
php artisan d1:migrate rollback
php artisan d1:migrate status
php artisan make:d1 {name}
Command Options
d1:migrate
--connection= : The database connection to use --force : Force the operation to run when in production
make:d1
--name= : The name of the migration file
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Adam Rollinson
- Alex Renoki - For the inspiration and base code for this package.