laravel/framework · error · InvalidArgumentException
Driver [{$config['driver']}] is not supported.
Error message
Driver [{$config['driver']}] is not supported. What it means
Thrown by BroadcastManager::resolve() when the connection config exists but its 'driver' value has no matching create{Driver}Driver method and no custom creator registered via Broadcast::extend(). Built-ins are reverb, pusher, ably, redis, log, null.
Source
Thrown at src/Illuminate/Broadcasting/BroadcastManager.php:313
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
protected function resolve($name)
{
$config = $this->getConfig($name);
if (is_null($config)) {
throw new InvalidArgumentException("Broadcast connection [{$name}] is not defined.");
}
if (isset($this->customCreators[$config['driver']])) {
return $this->callCustomCreator($config);
}
$driverMethod = 'create'.ucfirst($config['driver']).'Driver';
if (! method_exists($this, $driverMethod)) {
throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported.");
}
try {
return $this->{$driverMethod}($config);
} catch (Throwable $e) {
throw new RuntimeException("Failed to create broadcaster for connection \"{$name}\" with error: {$e->getMessage()}.", 0, $e);
}
}
/**
* Call a custom driver creator.
*
* @param array $config
* @return mixed
*/
protected function callCustomCreator(array $config)
{
return $this->customCreators[$config['driver']]($this->app, $config);View on GitHub (pinned to bd6b5437e6)
Solutions
- Register the custom driver: Broadcast::extend('mydriver', fn ($app, array $config) => new MyBroadcaster($config)).
- Use a supported driver (reverb/pusher/ably/redis/log/null).
- Correct the typo and ensure the package providing the driver is installed and its provider registered.
- Run config:clear after edits.
Example fix
// before
'connections' => [
'main' => ['driver' => 'websocket'], // no createWebsocketDriver
],
// after
'connections' => [
'main' => ['driver' => 'reverb', 'key' => env('REVERB_APP_KEY'), /* ... */],
],
// or in a service provider:
Broadcast::extend('websocket', fn ($app, $config) => new MyWebsocketBroadcaster($config)); Defensive patterns
Strategy: validation
Validate before calling
$driver = config("broadcasting.connections.{$name}.driver");
$supported = in_array($driver, ['reverb', 'pusher', 'ably', 'redis', 'log', 'null'], true);
if (! $supported) {
throw new RuntimeException("Broadcast driver [{$driver}] is not supported.");
} Type guard
function broadcastDriverIsSupported(string $driver): bool
{
return in_array($driver, ['reverb', 'pusher', 'ably', 'redis', 'log', 'null'], true);
} Try / catch
try {
Broadcast::driver($name);
} catch (\InvalidArgumentException $e) {
// fall back to a supported driver or register the custom one
} Prevention
- Register custom broadcast drivers with Broadcast::extend() in a service provider boot().
- Restrict config driver values to the supported set.
- Assert at boot that referenced broadcast drivers map to a create method or custom creator.
When it happens
Trigger: Setting broadcasting.connections.{name}.driver to 'websocket' (or a typo like 'pussher') without extending; referencing a driver from a package whose service provider did not boot.
Common situations: Renaming drivers across Laravel WebSockets -> Reverb migration; typo in the driver string; using a custom driver without registering Broadcast::extend().
Related errors
- Auth driver [{$config['driver']}] for guard [{$name}] is not
- Broadcast connection [{$name}] is not defined.
- Failed to create broadcaster for connection "{$name}" with e
- Callback must be a callable, callback array, or a 'Class@met
- Auth guard [{$name}] is not defined.
AI-assisted analysis of laravel/framework@bd6b5437e6 (2026-08-06).
Data as JSON: /data/errors/7b45801ab92b339d.json.
Report an issue: GitHub.