Laravel向当地磁盘添加了两个目录



filesystem.php如何将另一个目录添加到本地磁盘。目前只有图像目录

'disks' => [
    'local' => [
        'driver' => 'local',
        'root' => public_path('images/'),
    ],
    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],

您只能指定config/filesystems.php中定义的每个磁盘的根。但是,您可以自由定义尽可能多的磁盘:

'images-subdir' => [
    'driver' => 'local',
    'root' => public_path('images/subdir'),
],

如果我正确理解您的问题,您需要:

'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ]

来源:https://github.com/laravel/laravel/laravel/blob/master/config/filesystems.php

最新更新