如何读取config / filesystems.php

时间:2019-07-01 08:00:30

标签: laravel-5 configuration filesystems

在laravel 5.8中如何使用默认值读取config / filesystems.php的值:

return [

    'default' => env('FILESYSTEM_DRIVER', 'local'),


    'cloud' => env('FILESYSTEM_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',
        ],

我期望是:

$filesystem_pablic_path  = config('filesystem.disks.public');

但是返回空值...

1 个答案:

答案 0 :(得分:1)

尝试复数。 $filesystem_pablic_path = config('filesystems.disks.public');