laravel/framework · error · InvalidArgumentException
Driver [{$driver}] is not supported.
Error message
Driver [{$driver}] is not supported. What it means
Thrown by FilesystemManager::resolve() when the configured 'driver' string has no corresponding create{Driver}Driver method on the manager and no custom creator was registered via extend(). Laravel ships with local, ftp, sftp, s3, and scoped; any other string is unsupported unless you register it.
Source
Thrown at src/Illuminate/Filesystem/FilesystemManager.php:155
*/
protected function resolve($name, $config = null)
{
$config ??= $this->getConfig($name);
if (empty($config['driver'])) {
throw new InvalidArgumentException("Disk [{$name}] does not have a configured driver.");
}
$driver = $config['driver'];
if (isset($this->customCreators[$driver])) {
return $this->callCustomCreator($config);
}
$driverMethod = 'create'.ucfirst($driver).'Driver';
if (! method_exists($this, $driverMethod)) {
throw new InvalidArgumentException("Driver [{$driver}] is not supported.");
}
return $this->{$driverMethod}($config, $name);
}
/**
* Call a custom driver creator.
*
* @param array $config
* @return \Illuminate\Contracts\Filesystem\Filesystem
*/
protected function callCustomCreator(array $config)
{
return $this->customCreators[$config['driver']]($this->app, $config);
}
/**
* Create an instance of the local driver.View on GitHub (pinned to bd6b5437e6)
Solutions
- Register the custom driver: Storage::extend('gcs', fn($app,$config) => ...).
- Install the missing Flysystem adapter package (e.g. league/flysystem-aws-s3-v3).
- Correct the driver string typo in config/filesystems.php.
- Ensure the third-party provider is in config/app.php providers or discovered via package discovery.
Example fix
// before - 'gcs' driver unknown
Storage::disk('gcs')->put('x', 'y');
// after - register the custom driver in a service provider's boot
use Google\Cloud\Storage\StorageClient;
use League\Flysystem\GoogleCloudStorage\GoogleCloudStorageAdapter;
Storage::extend('gcs', function ($app, $config) {
$client = new StorageClient($config);
$bucket = $client->bucket($config['bucket']);
$adapter = new GoogleCloudStorageAdapter($bucket);
return new \Illuminate\Filesystem\FilesystemAdapter(
new \League\Flysystem\Filesystem($adapter), $adapter, $config
);
}); Defensive patterns
Strategy: validation
Validate before calling
use Illuminate\Filesystem\FilesystemManager;
$driver = config("filesystems.disks.{$name}.driver");
if (! method_exists(FilesystemManager::class, 'create' . ucfirst($driver) . 'Driver')
&& ! app('filesystem')->getAdapter(/* resolved via extend registry */)) {
throw new RuntimeException("Driver [{$driver}] not registered");
} Type guard
function driverIsRegistered(string $driver): bool
{
$method = 'create' . ucfirst($driver) . 'Driver';
return method_exists(\Illuminate\Filesystem\FilesystemManager::class, $method);
} Try / catch
try {
return Storage::disk($name);
} catch (\InvalidArgumentException $e) {
if (str_contains($e->getMessage(), 'is not supported')) {
abort(500, "Storage driver not installed/registered");
}
throw $e;
} Prevention
- Install the Flysystem adapter package for each non-built-in driver.
- Register custom drivers with Storage::extend() in a service provider.
- Check driver string spelling against config.
When it happens
Trigger: Calling Storage::disk($name) where the disk config 'driver' is something like 'gcs', 'azure', 'dropbox', or a typo ('locale', 's3v3') and you did not register a custom creator with Storage::extend('gcs', ...).
Common situations: Using a third-party driver (Google Cloud, Azure Blob) whose package's service provider wasn't registered; typoing 'local' or 's3'; upgrading Laravel and forgetting to install league/flysystem adapters (e.g. missing league/flysystem-aws-s3-v3 for 's3').
Related errors
- This driver does not support retrieving URLs.
- Disk [{$name}] does not have a configured driver.
- Auth driver [{$config['driver']}] for guard [{$name}] is not
- Driver [{$config['driver']}] is not supported.
- Unsupported driver [{$config['driver']}].
AI-assisted analysis of laravel/framework@bd6b5437e6 (2026-08-06).
Data as JSON: /data/errors/58542fda48d5be93.json.
Report an issue: GitHub.