Comments (2)
Easy enough to add a service provider
namespace App\Providers;
use BunnyCDN\Storage\BunnyCDNStorage;
use Illuminate\Support\ServiceProvider;
use League\Flysystem\Filesystem;
use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNAdapter;
use Storage;
class BunnycdnServiceProvider extends ServiceProvider
{
public function boot()
{
Storage::extend('bunnycdn', function ($app, $config) {
$client = new BunnyCDNStorage(
$config['zone'],
$config['key']
);
//disable_asserts is needed otherwise delete call fails as file is not found somehow even though exists
$config = ['disable_asserts' => true];
return new Filesystem(new BunnyCDNAdapter($client), $config);
});
}
public function register()
{
//
}
}
and add to your disks in config filesystems.php
'disks' => [
'bunnycdn' => [
'driver' => 'bunnycdn',
'zone' => '',
'key' => '',
'base_url' => '',
'token' => '',
],
from flysystem-bunnycdn.
Super cool work @jeremyj11, thanks for that. I also found a package implimentation here as well:
https://github.com/Katzen48/laravel-bunnycdn
from flysystem-bunnycdn.
Related Issues (20)
- Please provide some tutorial or sample with Laravel 8 HOT 5
- Crash in normalizeObject HOT 6
- "Unknown Mimetype" exception thrown HOT 5
- getObject doesn't pass proper path to the listContents function HOT 1
- lastModified does not throw error when path is a directory HOT 2
- Set root path on config
- listContents with deep option does not work
- features + fixes HOT 5
- Cannot instantiate interface League\Flysystem\FilesystemAdapter
- Can't request file containing json HOT 2
- Problems when path includes storage zone name HOT 1
- I cannot get it working
- [FEATURE] Use path-prefixing instead of own implementation HOT 3
- FEATURE support Temporary URLs HOT 1
- [Question] Path Prefixing HOT 8
- Mime type exception
- [Closed] HOT 2
- [Bugs] BunnyCDNException dont work properly
- Driver [bunnycdn] is not supported. HOT 1
- delete without any input should throw an error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flysystem-bunnycdn.