mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-08 16:14:13 +00:00
refactor(platform): rewrite legacy-era regions of the mail request, template command, storage provider and routes in place
This commit is contained in:
@@ -12,14 +12,11 @@ use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use League\Flysystem\Filesystem;
|
||||
use Spatie\Dropbox\Client as DropboxClient;
|
||||
use Spatie\Dropbox\Client;
|
||||
use Spatie\FlysystemDropbox\DropboxAdapter;
|
||||
|
||||
class StorageServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->singleton(FileDiskService::class);
|
||||
@@ -41,16 +38,16 @@ class StorageServiceProvider extends ServiceProvider
|
||||
MigrateMediaToPrivateDisk::class,
|
||||
]);
|
||||
|
||||
Storage::extend('dropbox', function ($app, $config) {
|
||||
$client = new DropboxClient(
|
||||
$config['token']
|
||||
);
|
||||
$dropboxDriver = function ($app, $config) {
|
||||
$client = new Client($config['token']);
|
||||
|
||||
$root = trim($config['root'] ?? '', '/');
|
||||
$adapter = new DropboxAdapter($client, $root);
|
||||
$flysystem = new Filesystem($adapter);
|
||||
|
||||
return new FilesystemAdapter($flysystem, $adapter, $config);
|
||||
});
|
||||
};
|
||||
|
||||
Storage::extend('dropbox', $dropboxDriver);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user