Laravel SFTP class not found

Atn*_*ize -1 php laravel composer-php

I upgraded laravel to V5.6.7 where sftp driver is included.

I have set my config in config/filesystems.php

'sftp' => [
    'driver'   => 'sftp',
    'host'     => 'myhost.com',
    'username' => 'user',
    'password' => 'password',
],
Run Code Online (Sandbox Code Playgroud)

And when I do

dd( Storage::disk('sftp')->files('/') );

This throw Class 'League\Flysystem\Sftp\SftpAdapter' not found

实际上,该类在我的供应商文件夹中不存在。

但是我composer.json就是这样

{
    "require": {
        ....
        "laravel/framework": "~5.6.7",
        ....
},
Run Code Online (Sandbox Code Playgroud)

composer update告诉我,一切都更新。

我应该怎么做才能上这堂课?


PS:当我转储另一个磁盘时,它运行良好

Yee*_*oow 5

从github上的PR

SFTP驱动程序需要League / flysystem-sftp,因此应像AWS或Rackspace驱动程序一样将其添加到composer文件中。

你需要这样做

composer require league/flysystem-sftp
Run Code Online (Sandbox Code Playgroud)

这里的说明

@Devon(谢谢)

来自LARAVEL.COM

Driver Prerequisites
Composer Packages
Before using the SFTP, S3, or Rackspace drivers, you will need to install the appropriate package via Composer:

SFTP: league/flysystem-sftp ~1.0
Amazon S3: league/flysystem-aws-s3-v3 ~1.0
Rackspace: league/flysystem-rackspace ~1.0
Run Code Online (Sandbox Code Playgroud)

  • Laravel 文档也提到了这一点:https://laravel.com/docs/5.6/filesystem#configuration (2认同)