PHPackages                             reusser/laravel-cloudflare-r2 - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. reusser/laravel-cloudflare-r2

ActiveLibrary[File &amp; Storage](/categories/file-storage)

reusser/laravel-cloudflare-r2
=============================

Cloudflare R2 integration for Laravel's Storage API

1.0.1(1y ago)75.0k↑19.6%[2 PRs](https://github.com/reusserdesign/laravel-cloudflare-r2/pulls)MITPHPPHP ^8.2CI failing

Since Mar 18Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/reusserdesign/laravel-cloudflare-r2)[ Packagist](https://packagist.org/packages/reusser/laravel-cloudflare-r2)[ Docs](https://github.com/reusserdesign/laravel-cloudflare-r2)[ RSS](/packages/reusser-laravel-cloudflare-r2/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (15)Versions (5)Used By (0)

Cloudflare R2 integration for Laravel's Storage API
===================================================

[](#cloudflare-r2-integration-for-laravels-storage-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4fa4cc058354a00f3b6cf43dc543b1fcb8872055803ff441f8e76258e0496c3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726575737365722f6c61726176656c2d636c6f7564666c6172652d72322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/reusser/laravel-cloudflare-r2)[![GitHub Tests Action Status](https://camo.githubusercontent.com/ba01d937737b557071d5e41eff0001d974655d5cfd239ddfe95437a4f23d6107/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726575737365722f6c61726176656c2d636c6f7564666c6172652d72322f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/reusserdesign/laravel-cloudflare-r2/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/7cdc8a4205ec11416af59e196aeb75ee290ff0d999f049d0620380210f190bc7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726575737365722f6c61726176656c2d636c6f7564666c6172652d72322f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/reusserdesign/laravel-cloudflare-r2/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/26c7d3c4c4bfa9e91c1b1947c5fafa98883ae042212135b38092d35862d5c50d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726575737365722f6c61726176656c2d636c6f7564666c6172652d72322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/reusser/laravel-cloudflare-r2)

Cloudflare R2 integration for Laravel's Storage API

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require reusser/laravel-cloudflare-r2
```

### Option 1: Use a new Disk

[](#option-1-use-a-new-disk)

Add this to the disks section of config/filesystems.php:

```
        'r2' => [
            'driver' => 'r2',
            'key' => env('R2_ACCESS_KEY_ID'),
            'secret' => env('R2_SECRET_ACCESS_KEY'),
            'region' => env('R2_DEFAULT_REGION', 'us-east-1'),
            'bucket' => env('R2_BUCKET'),
            'url' => env('R2_URL'),
            'endpoint' => env('R2_ENDPOINT', false),
            'use_path_style_endpoint' => env('R2_USE_PATH_STYLE_ENDPOINT', false),
            'throw' => false,
        ],
```

And fill out these in your .env:

```
R2_URL=https://some-worker.randomid.workers.dev
R2_ENDPOINT=https://randomid.r2.cloudflarestorage.com
R2_ACCESS_KEY_ID=random-key
R2_SECRET_ACCESS_KEY=random-secret
R2_BUCKET=bucket
R2_DEFAULT_REGION=us-east-1
R2_USE_PATH_STYLE_ENDPOINT=false
```

### Option 2: Use S3 Disk

[](#option-2-use-s3-disk)

Change your s3 disk to the R2 driver in config/filesystems.php:

```
        's3' => [
            'driver' => 'r2',
            ...
```

And fill out these in your .env:

```
AWS_URL=https://some-worker.randomid.workers.dev
AWS_ENDPOINT=https://random-id.r2.cloudflarestorage.com
AWS_ACCESS_KEY_ID=random-key
AWS_SECRET_ACCESS_KEY=random-secret
AWS_BUCKET=some-bucket
AWS_DEFAULT_REGION=us-east-1
AWS_USE_PATH_STYLE_ENDPOINT=false
```

FAQ
---

[](#faq)

### Is this package really necessary?

[](#is-this-package-really-necessary)

No, you can use the `s3` driver with Cloudflare R2, but this package makes it easier to use. Just be sure to set `'retain_visibility' => false,` in your standard `s3` configuration to prevent incompatibility issues.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Austin Drummond](https://github.com/adrum)
- [Jake Ryan Smith](https://github.com/jakeryansmith)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance69

Regular maintenance activity

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~348 days

Total

2

Last Release

443d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/61243fe9ca8ecdca0d8e592450b48947f1d1cafbbdcf8c851298bb11c0af1c4a?d=identicon)[reusserdesign](/maintainers/reusserdesign)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![adrum](https://avatars.githubusercontent.com/u/1464185?v=4)](https://github.com/adrum "adrum (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![jakeryansmith](https://avatars.githubusercontent.com/u/6209794?v=4)](https://github.com/jakeryansmith "jakeryansmith (1 commits)")

---

Tags

laravelreusserlaravel-cloudflare-r2

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/reusser-laravel-cloudflare-r2/health.svg)

```
[![Health](https://phpackages.com/badges/reusser-laravel-cloudflare-r2/health.svg)](https://phpackages.com/packages/reusser-laravel-cloudflare-r2)
```

###  Alternatives

[spatie/livewire-filepond

Upload files using Filepond in Livewire components

306452.7k3](/packages/spatie-livewire-filepond)[elegantly/laravel-invoices

Store invoices safely in your Laravel application

23131.8k](/packages/elegantly-laravel-invoices)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[mwguerra/filemanager

A full-featured file manager package for Laravel and Filament v5 with dual operating modes, drag-and-drop uploads, S3/MinIO support, and comprehensive security features.

718.5k1](/packages/mwguerra-filemanager)[codebar-ag/laravel-flysystem-cloudinary

Cloudinary Flysystem v1 integration with Laravel

1224.9k2](/packages/codebar-ag-laravel-flysystem-cloudinary)[mreduar/s3m

Multipart Uploads using Laravel and AWS S3

173.6k](/packages/mreduar-s3m)

PHPackages © 2026

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