laravel-cloudflare-driver maintained by adamrollinson
Description
Laravel integration for Cloudflare Workers services
Author
Last update
2026/03/30 15:56
(dev-dependabot/composer/saloonphp/saloon-tw-4.0)
License
Downloads
5
Tags
database - php - sqlite - query - laravel - cloudflare - workers - serverless - kv - r2 - d1 - serverless-functions - serverless-framework - serverless-architecture - adam-rollinson - laravel-cloudflare-driver
Laravel Cloudflare Driver
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.