jeudi 28 mai 2020

Laravel dynamic config variable get

This is my config/filesystems.php file.

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

'disks' => [
       's3' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
        ],
       'b2' => [
            'driver' => 's3',
            'key' => env('B2_KEY_ID'),
            'secret' => env('B2_APP_KEY'),
        ],
]

How can I get default filesystem's key value? I think this is possible.

config("filesystems.disks." . config("filesystems.default") . ".key");

I believe there is any better way. Can anyone help me?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire