Skip to content

Commit

Permalink
Merge pull request #1 from Jasongzj/master
Browse files Browse the repository at this point in the history
add getUrl plugins
  • Loading branch information
overtrue authored Jun 9, 2020
2 parents b1a597d + a0083bf commit 9beed80
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/CosStorageServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Illuminate\Support\ServiceProvider;
use League\Flysystem\Filesystem;
use Overtrue\Flysystem\Cos\CosAdapter;
use Overtrue\Flysystem\Cos\Plugins\FileUrl;

/**
* Class CosStorageServiceProvider
Expand All @@ -25,7 +26,12 @@ class CosStorageServiceProvider extends ServiceProvider
public function boot()
{
Storage::extend('cos', function () {
return new Filesystem(new CosAdapter(\config('filesystems.disks.cos')));
$adapter = new CosAdapter(\config('filesystems.disks.cos'));

$filesystem = new Filesystem($adapter);
$filesystem->addPlugin(new FileUrl());

return new Filesystem();
});
}

Expand Down

0 comments on commit 9beed80

Please sign in to comment.