【问题标题】:Laravel 5.2 InvalidArgumentException in FilesystemManager.php line 121: Driver [] is not supportedFilesystemManager.php 第 121 行中的 Laravel 5.2 InvalidArgumentException:不支持驱动程序 []
【发布时间】:2020-08-01 13:39:28
【问题描述】:

文件系统.php

当我尝试在 Laravel 5.2 中创建新磁盘时遇到一些问题

'disks' => [
        'local' => [
            'driver' => 'local',
            'root' => storage_path('app'),
        ],
        'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'visibility' => 'public',
        ],
        'manifest' => [ // it´s works if only stay this 
            'driver' => 'local',
            'root' => storage_path('../../manifestations_media'), 
            'visibility' => 'public',
        ],
        'documentos' => [ // if add this nothing works
            'driver' => 'local',
            'root' => storage_path('../../documentos'),
            'visibility' => 'public',
        ],
        
        's3' => [
            'driver' => 's3',
            'key' => 'your-key',
            'secret' => 'your-secret',
            'region' => 'your-region',
            'bucket' => 'your-bucket',
        ],
        

    ],

我不知道为什么会失败,但是如果我尝试添加新磁盘失败,所有配置都不起作用。有人可以帮我理解为什么吗?

$mytime = time();
        $ext = pathinfo($request->myfile->getClientOriginalName(), PATHINFO_EXTENSION);
        $filename = sha1_file($request->file('myfile')->getRealPath()) . $mytime . "." . $ext;
        Storage::disk('documentos')->put($filename, file_get_contents($request->file('myfile')->getRealPath()));
        DB::update('update cities set document = ? where id = ?', [$filename, $data]);

【问题讨论】:

  • 从问题中,我没有得到确切的问题。如果它不起作用,您会遇到什么错误?
  • 主题标签的错误,如果在 Laravel 5.2 中添加文档,我无法上传文件清单或文档,但如果我删除文档清单可以正常工作。

标签: php laravel


【解决方案1】:

我解决了我的问题,更改了 Laravel 6 版本。这个错误没有。我不知道为什么会在 Laravel 5.2 中发生。可能我改变了一些我不记得的东西,但目前它有效

【讨论】:

    猜你喜欢
    • 2018-04-14
    • 2016-01-27
    • 1970-01-01
    • 2016-09-09
    • 1970-01-01
    • 2016-06-30
    • 2016-02-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多