feat(config): add Cloudflare R2 filesystem configuration

- Added new environment variables for Cloudflare R2 access key, secret access key, bucket, endpoint, and URL in the .env.example file.
- Updated composer.json to include the league/flysystem-aws-s3-v3 package.
- Modified the filesystems.php configuration file to include a new 'r2' disk for Cloudflare R2 storage.
This commit is contained in:
Rico van Zelst
2024-01-07 03:02:40 +01:00
parent 9872e5254b
commit 2e7e7dc2a9
4 changed files with 302 additions and 1 deletions

View File

@@ -44,6 +44,19 @@ return [
'throw' => false,
],
'r2' => [
'driver' => 's3',
'key' => env('CLOUDFLARE_R2_ACCESS_KEY_ID'),
'secret' => env('CLOUDFLARE_R2_SECRET_ACCESS_KEY'),
'region' => 'auto', // != Cloudflare R2 doesn't have specific regions, so 'us-east-1' is fine.
'bucket' => env('CLOUDFLARE_R2_BUCKET'),
'url' => env('CLOUDFLARE_R2_URL'),
'visibility' => 'private',
'endpoint' => env('CLOUDFLARE_R2_ENDPOINT'),
'use_path_style_endpoint' => env('CLOUDFLARE_R2_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),