mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 21:44:51 +00:00
39 lines
762 B
PHP
39 lines
762 B
PHP
<?php
|
|
|
|
namespace InvoiceShelf\Providers;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use League\Flysystem\Filesystem;
|
|
use Spatie\Dropbox\Client as DropboxClient;
|
|
use Spatie\FlysystemDropbox\DropboxAdapter;
|
|
|
|
class DropboxServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
Storage::extend('dropbox', function ($app, $config) {
|
|
$client = new DropboxClient(
|
|
$config['token']
|
|
);
|
|
|
|
return new Filesystem(new DropboxAdapter($client));
|
|
});
|
|
}
|
|
}
|