我无法弄清楚我要去哪里错了,这个。我spatie/flysystem-dropbox
通过 composer 安装遵循 Laravel 文档,从 Laravel 文档复制了 DropboxServiceProvider,将提供的服务添加到config\app.php
运行composer dump autoload
但我仍然收到以下错误消息:
PHP error: Undefined index: driver in /***/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php on line 112
这是服务提供商:
<?php
namespace App\Providers;
use Storage;
use League\Flysystem\Filesystem;
use Spatie\Dropbox\Client as DropboxClient;
use Illuminate\Support\ServiceProvider;
use Spatie\FlysystemDropbox\DropboxAdapter;
class DropboxServiceProvider extends ServiceProvider
{
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot()
{
Storage::extend('dropbox', function ($app, $config) {
$client = new DropboxClient(
$config['authorizationToken']
);
return new Filesystem(new DropboxAdapter($client));
});
}
/**
* Register bindings in the container.
*
* @return void
*/
public function register()
{
//
}
}
这是我的配置/应用程序/php:
...
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\DropboxServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
...
最后,这是我的 config/filesystems.php:
'dropbox'=>[
'authorizationToken'=>env('DROPBOX_ACCESS_TOKEN')
],