{"id":"c5cd88ff8edd98e9","repo":"laravel/framework","slug":"driver-config-driver-is-not-supported-c5cd88","errorCode":null,"errorMessage":"Driver [{$config['driver']}] is not supported.","messagePattern":"Driver \\[(.+?)\\] is not supported\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Cache/CacheManager.php","lineNumber":151,"sourceCode":"     * @return \\Illuminate\\Cache\\Repository\n     *\n     * @throws \\InvalidArgumentException\n     */\n    public function build(array $config)\n    {\n        $config = Arr::add($config, 'store', $config['name'] ?? 'ondemand');\n\n        if (isset($this->customCreators[$config['driver']])) {\n            return $this->callCustomCreator($config);\n        }\n\n        $driverMethod = 'create'.ucfirst($config['driver']).'Driver';\n\n        if (method_exists($this, $driverMethod)) {\n            return $this->{$driverMethod}($config);\n        }\n\n        throw new InvalidArgumentException(\"Driver [{$config['driver']}] is not supported.\");\n    }\n\n    /**\n     * Call a custom driver creator.\n     *\n     * @param  array  $config\n     * @return mixed\n     */\n    protected function callCustomCreator(array $config)\n    {\n        return $this->customCreators[$config['driver']]($this->app, $config);\n    }\n\n    /**\n     * Create an instance of the APC cache driver.\n     *\n     * @param  array  $config\n     * @return \\Illuminate\\Cache\\Repository","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Cache/CacheManager.php#L133-L169","documentation":"CacheManager::build() looks for a custom creator registered via extend(), then for a create{Driver}Driver method; if neither exists it throws InvalidArgumentException. The driver value comes from the store's 'driver' config key and must map to a built-in driver or a registered custom one.","triggerScenarios":"Setting 'driver' => 'dynamodb' in a store but not having the aws/aws-sdk-php dependency. Typing the driver name (e.g. 'memcashed'). Registering a custom driver via Cache::extend() after config is cached, or in a service provider that didn't run.","commonSituations":"Missing PHP extension or composer package for a driver (apcu, memcached, dynamodb). Custom driver extend() call placed in a non-booted provider or removed by refactoring. Case-sensitivity mistakes (driver names are lowercased via ucfirst only on the method name).","solutions":["Fix the 'driver' spelling in config/cache.php to a supported name (file, redis, database, array, null, dynamodb, memcached, apc, etc.).","Install the required composer/extension for that driver (e.g. composer require aws/aws-sdk-php for dynamodb).","For custom drivers, call Cache::extend('name', fn ...) inside a booted ServiceProvider boot() method and run config:clear.","Run php artisan config:clear to drop a stale config cache that lacks the extend registration."],"exampleFix":"// before\n'stores' => [\n    'my' => [\n        'driver' => 'custm',\n        'path' => storage_path('framework/cache/data'),\n    ],\n],\n\n// after\n'stores' => [\n    'my' => [\n        'driver' => 'file',\n        'path' => storage_path('framework/cache/data'),\n    ],\n],\n// or register: Cache::extend('custm', fn($app,$config) => ...);","handlingStrategy":"validation","validationCode":"$driver = config('cache.stores.my.driver');\n$supported = ['array','file','redis','database','dynamodb','memcached','apc','null'];\nif (! in_array($driver, $supported, true) && ! app('cache')->getDrivers()->has($driver)) {\n    throw new \\RuntimeException(\"Unsupported cache driver [{$driver}].\");\n}","typeGuard":"function cacheDriverIsSupported(string $driver): bool\n{\n    $builtin = ['array','file','redis','database','dynamodb','memcached','apc','null','failover','storage'];\n    return in_array($driver, $builtin, true)\n        || app()->bound(\"cache.extend.{$driver}\");\n}","tryCatchPattern":"try {\n    Cache::store('my')->get('k');\n} catch (\\InvalidArgumentException $e) {\n    if (str_contains($e->getMessage(), 'is not supported')) {\n        // fix driver spelling or install dependency, then config:clear\n    }\n    throw $e;\n}","preventionTips":["List driver dependencies (SDKs/extensions) in composer/README.","Register custom drivers in a booted provider.","Run config:clear after driver changes.","Add CI checks for required PHP extensions."],"tags":["cache","configuration","drivers","dependencies"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}