mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
build version 400
This commit is contained in:
39
app/Providers/DropboxServiceProvider.php
Normal file
39
app/Providers/DropboxServiceProvider.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Crater\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
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));
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user