Skip to content

Error: Undefined array key "driver" with Multidimensional Config Values for Disks in Laravel ^11.23.0 #53032

@jaapredeker

Description

@jaapredeker

Laravel Version

11.23.0

PHP Version

8.3.11

Database Driver & Version

No response

Description

When using Laravel version ^11.23.0, I encounter an error Undefined array key "driver" when I have multidimensional config values for disks.

Steps To Reproduce

  1. Define a multidimensional config value for disks in config/filesystems.php.
  2. Attempt to use the filesystem configuration in the application.

Expected Behavior: The application should correctly handle multidimensional config values for disks without throwing an error.

Actual Behavior: The application throws an error: Undefined array key "driver".

File that throws error:
src/Illuminate/Filesystem/FilesystemServiceProvider.php:114

Example Configuration:

'disks' => [
    'example' => [
        'driver' => 'local',
        'root' => storage_path('app/example'),
        'throw' => true,
    ],
    'nested' => [
        'level1' => [
            'driver' => 'local',
            'root' => storage_path('app/nested/level1'),
            'throw' => true,
        ],
    ],
],

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions