{"id":"d3eb4f3f3ce180c3","repo":"laravel/framework","slug":"disk-name-does-not-have-a-configured-driver","errorCode":null,"errorMessage":"Disk [{$name}] does not have a configured driver.","messagePattern":"Disk \\[(.+?)\\] does not have a configured driver\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Filesystem/FilesystemManager.php","lineNumber":143,"sourceCode":"    {\n        return $this->disks[$name] ?? $this->resolve($name);\n    }\n\n    /**\n     * Resolve the given disk.\n     *\n     * @param  string  $name\n     * @param  array|null  $config\n     * @return \\Illuminate\\Contracts\\Filesystem\\Filesystem\n     *\n     * @throws \\InvalidArgumentException\n     */\n    protected function resolve($name, $config = null)\n    {\n        $config ??= $this->getConfig($name);\n\n        if (empty($config['driver'])) {\n            throw new InvalidArgumentException(\"Disk [{$name}] does not have a configured driver.\");\n        }\n\n        $driver = $config['driver'];\n\n        if (isset($this->customCreators[$driver])) {\n            return $this->callCustomCreator($config);\n        }\n\n        $driverMethod = 'create'.ucfirst($driver).'Driver';\n\n        if (! method_exists($this, $driverMethod)) {\n            throw new InvalidArgumentException(\"Driver [{$driver}] is not supported.\");\n        }\n\n        return $this->{$driverMethod}($config, $name);\n    }\n\n    /**","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Filesystem/FilesystemManager.php#L125-L161","documentation":"Thrown by FilesystemManager::resolve() when the resolved disk config array has no 'driver' key. Laravel selects the adapter factory by the 'driver' field; an empty value means the disk is not actually configured, so building it would be meaningless.","triggerScenarios":"Calling Storage::disk($name) where $name has no entry under filesystems.disks in config, or whose entry exists but omits 'driver'. Also triggered when env vars backing the driver are unset and config returns [].","commonSituations":"Referencing a disk name that doesn't exist; missing FILESYSTEM_DRIVER env var; typo in the disk key; env-based driver (`'driver' => env('FS_DRIVER')`) where the env is unset yielding null.","solutions":["Add the disk to config/filesystems.php under filesystems.disks with a 'driver' key.","Set the missing env var (e.g. FILESYSTEM_DRIVER=local).","Check the disk name spelling and case.","Run `php artisan config:cache` after editing config so changes take effect."],"exampleFix":"// before - 'reports' disk referenced but not configured\nStorage::disk('reports')->put('x.txt', 'hi');\n\n// after - add to config/filesystems.php\n// 'disks' => [\n//     'reports' => ['driver' => 'local', 'root' => storage_path('app/reports')],\n// ]\nStorage::disk('reports')->put('x.txt', 'hi');","handlingStrategy":"validation","validationCode":"$config = config(\"filesystems.disks.{$name}\");\nif (empty($config) || empty($config['driver'])) {\n    throw new RuntimeException(\"Disk [{$name}] is not configured\");\n}\nreturn Storage::disk($name);","typeGuard":"function diskIsConfigured(string $name): bool\n{\n    $cfg = config(\"filesystems.disks.{$name}\");\n    return is_array($cfg) && !empty($cfg['driver']);\n}","tryCatchPattern":"try {\n    return Storage::disk($name);\n} catch (\\InvalidArgumentException $e) {\n    if (str_contains($e->getMessage(), 'does not have a configured driver')) {\n        abort(500, \"Storage disk [{$name}] misconfigured\");\n    }\n    throw $e;\n}","preventionTips":["Define every referenced disk in config/filesystems.php.","Set all env vars backing disk driver config.","Validate disk config at boot in service providers."],"tags":["filesystem","configuration","disk","driver","env"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}