Digitalocean Spaces Laravel 应用程序 - 缺少区域

Digitalocean Spaces Laravel App - Missing region

我收到以下错误:

Missing required client configuration options: region: (string) A “region” configuration value is required for the “s3” service (e.g., “us-west-2”).

这是我的设置(XXX 隐藏我的身份):

.env 文件:

DO_SPACES_KEY=XXXXX
DO_SPACES_SECRET=XXXX
DO_SPACES_ENDPOINT=https://nyc3.digitaloceanspaces.com
DO_SPACES_REGION=NYC3
DO_SPACES_BUCKET=XXXX

filesystems.php 文件(磁盘下):

 'do_spaces' => [
        'driver' => 's3',
        'key' => env('XXXXX'),
        'secret' => env('XXXXX'),
        'endpoint' => env('https://nyc3.digitaloceanspaces.com'),
        'region' => env('NYC3'),
        'bucket' => env('XXXXXX'),
        ],

也在 filesystems.php 文件中:

‘cloud’ => env('FILESYSTEM_CLOUD’, 'do_spaces’),

在视图文件中:

function addDocument(Request $req, $projId)
{
       
        $image = $req->file('uploadFile');


        $file_name = pathinfo($image->getClientOriginalName(), PATHINFO_FILENAME);

        $input['imagename'] = $file_name.'_'.time().'.'.$image->getClientOriginalExtension();

        //$destinationPath = public_path('/images');

        //$image->move($destinationPath, $input['imagename']);

        $destinationPath = $image->store('/', 'do_spaces');
        Storage::setVisibility($destinationPath, 'public');

        //$data = array('fid'=>$folderId,'fileLoc'=>$input['imagename'],'projId'=>$projId);
        //\DB::table('documents')->insert($data);

return back();

}

正如您在视图中看到的那样,我尝试将图像存储在 space 上,然后将路径存储在数据库中,这将代表 space 的路径。

我无法让这个错误消失;你看到任何问题了吗?

谢谢!

'region' => env('NYC3'), 应该是 'region' => env('DO_SPACES_REGION'),