【发布时间】:2017-05-05 23:28:16
【问题描述】:
其他人有这个问题:
我将我的 filesystems.php 配置 defualt 从 local 设置为 cloud(设置为我的 s3)并且我的存储代码出现此错误:
$path = $request->file('avatar')->store('avatars'); -> 在我的用户控制器中
错误:Driver [] is not supported.
如果我将文件系统配置保留为库存并仅运行此代码,则图像会很好地上传到我的 s3
$path = $request->file('avatar')->store('avatars', 's3'); -> 在我的用户控制器中
不应该$path = $request->file('avatar')->store('avatars'); 在不传递特定驱动程序的情况下运行默认值吗?我试过'default' => 's3', 得到同样的错误
配置驱动程序
'default' => 'local',
'cloud' => 's3',
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
'region' => env('AWS_REGION'),
'bucket' => env('AWS_BUCKET'),
],
],
【问题讨论】: