PHPackages                             platformcommunity/flysystem-bunnycdn - 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. platformcommunity/flysystem-bunnycdn

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

platformcommunity/flysystem-bunnycdn
====================================

Flysystem adapter for BunnyCDN

v3.3.10(3mo ago)94390.7k—0.4%23[7 issues](https://github.com/PlatformCommunity/flysystem-bunnycdn/issues)5MITPHPCI passing

Since Dec 8Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/PlatformCommunity/flysystem-bunnycdn)[ Packagist](https://packagist.org/packages/platformcommunity/flysystem-bunnycdn)[ RSS](/packages/platformcommunity-flysystem-bunnycdn/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (58)Used By (5)

[![Bunny CDN Logo](https://gist.githubusercontent.com/sifex/bb1ebae00c4c9a827a55a2b973fef0e7/raw/d79dab1b6959f580a3b7a2e6238dae7445203f2a/bunnycdn_logo.svg?sanitize=true)](https://gist.githubusercontent.com/sifex/bb1ebae00c4c9a827a55a2b973fef0e7/raw/d79dab1b6959f580a3b7a2e6238dae7445203f2a/bunnycdn_logo.svg?sanitize=true)

Flysystem Adapter for BunnyCDN Storage
======================================

[](#flysystem-adapter-for-bunnycdn-storage)

[![Build Status - Flysystem v2](https://camo.githubusercontent.com/8e6b2815fe57f3b63d4b22b9abd16386564acd4abb60e68a87a63644ea0a336e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f506c6174666f726d436f6d6d756e6974792f666c7973797374656d2d62756e6e7963646e2f7068702e796d6c3f6272616e63683d7632266c6162656c3d466c7973797374656d2532307632)](https://github.com/PlatformCommunity/flysystem-bunnycdn/actions) [![Build Status - Flysystem v3](https://camo.githubusercontent.com/e542235a0feae0c15eb0f54aa61cee99a1c12ccd61917b2ca0d6c1b6aa43c502/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f506c6174666f726d436f6d6d756e6974792f666c7973797374656d2d62756e6e7963646e2f7068702e796d6c3f6272616e63683d7633266c6162656c3d466c7973797374656d2532307633)](https://github.com/PlatformCommunity/flysystem-bunnycdn/actions)
[![Codecov](https://camo.githubusercontent.com/04c1cb82413b886cce349ab2c6fdcc95fc1333225f852070ccb109c967e1a3f4/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f506c6174666f726d436f6d6d756e6974792f666c7973797374656d2d62756e6e7963646e)](https://codecov.io/gh/PlatformCommunity/flysystem-bunnycdn) [![Packagist Version](https://camo.githubusercontent.com/200e891a9316273ad92c22a8b9056626ea06e4cb794c614cb8bcdb4a5012d218/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706c6174666f726d636f6d6d756e6974792f666c7973797374656d2d62756e6e7963646e)](https://packagist.org/packages/platformcommunity/flysystem-bunnycdn) [![Minimum PHP Version: 7.4](https://camo.githubusercontent.com/df31d339fd7a30cdfa120790cf1c9f4ad1c46ced156acf25038cbbcf7b2ed8c7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d6d696e253230372e342d696d706f7274616e74)](https://camo.githubusercontent.com/df31d339fd7a30cdfa120790cf1c9f4ad1c46ced156acf25038cbbcf7b2ed8c7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d6d696e253230372e342d696d706f7274616e74) [![Licence: MIT](https://camo.githubusercontent.com/03309b7fb1fa8e4d495ae49da44444e2ddf748b26fc94389e591258dc350aaac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706c6174666f726d636f6d6d756e6974792f666c7973797374656d2d62756e6e7963646e)](https://github.com/PlatformCommunity/flysystem-bunnycdn/blob/master/LICENSE) [![Downloads](https://camo.githubusercontent.com/9de9f9fa6010ce25ceb49803c3e98b686ab2cb435b1e928a558c0afffe5ad2ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f706c6174666f726d636f6d6d756e6974792f666c7973797374656d2d62756e6e7963646e)](https://packagist.org/packages/platformcommunity/flysystem-bunnycdn)

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

[](#installation)

To install `flysystem-bunnycdn`, require the package with no version constraint. This should match the `flysystem-bunnycdn` version with your version of FlySystem (v2, v3 etc).

```
composer require platformcommunity/flysystem-bunnycdn "*"
```

Usage
-----

[](#usage)

```
use League\Flysystem\Filesystem;
use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNAdapter;
use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNClient;
use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNRegion;

$adapter = new BunnyCDNAdapter(
    new BunnyCDNClient(
        'storage-zone',
        'api-key',
        BunnyCDNRegion::FALKENSTEIN
    )
);

// for temporary URL support, define a signing key
$adapter->setTokenAuthKey('token-auth-signing-key');

$filesystem = new Filesystem($adapter);
```

### Usage with Pull Zones

[](#usage-with-pull-zones)

To have BunnyCDN adapter publish to a public CDN location, you have to a "Pull Zone" connected to your BunnyCDN Storage Zone. Add the full URL prefix of your Pull Zone (including `http://`/`https://`) to the BunnyCDNAdapter parameter like shown below.

```
$adapter = new BunnyCDNAdapter(
    new BunnyCDNClient(
        'storage-zone',
        'api-key',
        BunnyCDNRegion::FALKENSTEIN
    ),
    'https://testing.b-cdn.net/' # Pull Zone URL
);

// for temporary URL support, define a signing key
$adapter->setTokenAuthKey('token-auth-signing-key');

$filesystem = new Filesystem($adapter);
```

*Note: You can also use your own domain name if it's configured in the pull zone.*

Once you add your pull zone, you can use the `->getUrl($path)`, or in Laravel, the `->url($path)` command to get the fully qualified public URL of your BunnyCDN assets.

Usage in Laravel 9 &amp; up
---------------------------

[](#usage-in-laravel-9--up)

To add BunnyCDN adapter as a custom storage adapter in Laravel 9, install using the `v3` composer installer.

```
composer require platformcommunity/flysystem-bunnycdn "^3.0"
```

Next, install the adapter to your `AppServiceProvider` to give Laravel's FileSystem knowledge of the BunnyCDN adapter.

```
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Storage::extend('bunnycdn', function ($app, $config) {
            $adapter = new BunnyCDNAdapter(
                new BunnyCDNClient(
                    $config['storage_zone'],
                    $config['api_key'],
                    $config['region']
                ),
                $config['pull_zone']
            );

            // for temporary URL support, define a signing key
            $adapter->setTokenAuthKey('token-auth-signing-key');

            return new FilesystemAdapter(
                new Filesystem($adapter, $config),
                $adapter,
                $config
            );
        });
    }
```

Finally, add the `bunnycdn` driver into your `config/filesystems.php` configuration file.

```
        ...

        'bunnycdn' => [
            'driver' => 'bunnycdn',
            'storage_zone' => env('BUNNYCDN_STORAGE_ZONE'),
            'pull_zone' => env('BUNNYCDN_PULL_ZONE'),
            'api_key' => env('BUNNYCDN_API_KEY'),
            'token_auth_key' => env('BUNNYCDN_TOKEN_AUTH_KEY', ''), // optional if you'd like signed URLs
            'region' => env('BUNNYCDN_REGION', \PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNRegion::DEFAULT)
        ],

        ...
```

Lastly, populate your `BUNNYCDN_STORAGE_ZONE`, `BUNNYCDN_API_KEY` `BUNNYCDN_REGION` variables in your `.env` file.

```
BUNNYCDN_STORAGE_ZONE=testing_storage_zone
BUNNYCDN_PULL_ZONE=https://testing.b-cdn.net
BUNNYCDN_API_KEY="api-key"
# BUNNYCDN_REGION=uk
#BUNNYCDN_TOKEN_AUTH_KEY="your-token-auth-key" (optional, under CDN > Security > Token Authentication)
```

After that, you can use the `bunnycdn` disk in Laravel 9.

```
Storage::disk('bunnycdn')->put('index.html', 'Hello World');

return response(Storage::disk('bunnycdn')->get('index.html'));
```

*Note: You may have to run `php artisan config:clear` in order for your configuration to be refreshed if your app is running with a config cache driver / production mode.*

Regions
-------

[](#regions)

For a full region list, please visit the [BunnyCDN API documentation page](https://docs.bunny.net/reference/storage-api#storage-endpoints).

`flysystem-bunnycdn` also comes with constants for each region located within `PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNRegion`.

### List of Regions

[](#list-of-regions)

```
# Europe
BunnyCDNRegion::FALKENSTEIN = 'de';
BunnyCDNRegion::STOCKHOLM = 'se';

# United Kingdom
BunnyCDNRegion::UNITED_KINGDOM = 'uk';

# USA
BunnyCDNRegion::NEW_YORK = 'ny';
BunnyCDNRegion::LOS_ANGELAS = 'la';

# SEA
BunnyCDNRegion::SINGAPORE = 'sg';

# Oceania
BunnyCDNRegion::SYDNEY = 'syd';

# Africa
BunnyCDNRegion::JOHANNESBURG = 'jh';

# South America
BunnyCDNRegion::BRAZIL = 'br';
```

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

[](#contributing)

Pull requests welcome. Please feel free to lodge any issues as discussion points.

Development
-----------

[](#development)

Most of the understanding of how the Flysystem Adapter for BunnyCDN works comes from `tests/`. If you want to complete tests against a live BunnyCDN endpoint, copy the `tests/ClientDI_Example.php` to `tests/ClientDI.php` and insert your credentials into there. You can then run the whole suite by running `vendor/bin/phpunit`, or against a specific file by running `vendor/bin/phpunit --bootstrap tests/ClientDI.php tests/ClientTest.php`.

Licence
-------

[](#licence)

The Flysystem adapter for Bunny.net is licensed under [MIT](https://github.com/PlatformCommunity/flysystem-bunnycdn/blob/master/LICENSE).

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance79

Regular maintenance activity

Popularity52

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 72.2% of commits — single point of failure

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 ~44 days

Recently: every ~3 days

Total

52

Last Release

103d ago

Major Versions

v1.3.0 → v2.3.02022-03-16

v1.3.1 → v2.3.12022-04-15

v2.3.1 → v3.1.12022-04-15

v2.4.0 → v3.3.02022-11-16

v1.x-dev → v3.3.22023-09-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2058557?v=4)[Alex](/maintainers/sifex)[@sifex](https://github.com/sifex)

---

Top Contributors

[![sifex](https://avatars.githubusercontent.com/u/2058557?v=4)](https://github.com/sifex "sifex (156 commits)")[![tinect](https://avatars.githubusercontent.com/u/135993?v=4)](https://github.com/tinect "tinect (30 commits)")[![chrispage1](https://avatars.githubusercontent.com/u/2487374?v=4)](https://github.com/chrispage1 "chrispage1 (14 commits)")[![stevenmond](https://avatars.githubusercontent.com/u/92689792?v=4)](https://github.com/stevenmond "stevenmond (6 commits)")[![ben182](https://avatars.githubusercontent.com/u/17678582?v=4)](https://github.com/ben182 "ben182 (2 commits)")[![n-e-m-a-nj-a](https://avatars.githubusercontent.com/u/3234686?v=4)](https://github.com/n-e-m-a-nj-a "n-e-m-a-nj-a (1 commits)")[![ralphjsmit](https://avatars.githubusercontent.com/u/59207045?v=4)](https://github.com/ralphjsmit "ralphjsmit (1 commits)")[![rickkuilman](https://avatars.githubusercontent.com/u/7881219?v=4)](https://github.com/rickkuilman "rickkuilman (1 commits)")[![joshbmarshall](https://avatars.githubusercontent.com/u/4043827?v=4)](https://github.com/joshbmarshall "joshbmarshall (1 commits)")[![slava-vishnyakov](https://avatars.githubusercontent.com/u/817931?v=4)](https://github.com/slava-vishnyakov "slava-vishnyakov (1 commits)")[![jjprojects](https://avatars.githubusercontent.com/u/32326340?v=4)](https://github.com/jjprojects "jjprojects (1 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (1 commits)")[![helloiamlukas](https://avatars.githubusercontent.com/u/15997450?v=4)](https://github.com/helloiamlukas "helloiamlukas (1 commits)")

---

Tags

bunnycdnbunnycdn-storagefilesystemflysystemflysystem-adapterhacktoberfestphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/platformcommunity-flysystem-bunnycdn/health.svg)

```
[![Health](https://phpackages.com/badges/platformcommunity-flysystem-bunnycdn/health.svg)](https://phpackages.com/packages/platformcommunity-flysystem-bunnycdn)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[google/cloud

Google Cloud Client Library

1.2k16.2M53](/packages/google-cloud)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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