{"record":{"id":"b0f268dcb03c4841","repo":"laravel/framework","slug":"broadcast-connection-name-is-not-defined","errorCode":null,"errorMessage":"Broadcast connection [{$name}] is not defined.","messagePattern":"Broadcast connection \\[(.+?)\\] is not defined\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Broadcasting/BroadcastManager.php","lineNumber":303,"sourceCode":"    {\n        return $this->drivers[$name] ?? $this->resolve($name);\n    }\n\n    /**\n     * Resolve the given broadcaster.\n     *\n     * @param  string  $name\n     * @return \\Illuminate\\Contracts\\Broadcasting\\Broadcaster\n     *\n     * @throws \\InvalidArgumentException\n     * @throws \\RuntimeException\n     */\n    protected function resolve($name)\n    {\n        $config = $this->getConfig($name);\n\n        if (is_null($config)) {\n            throw new InvalidArgumentException(\"Broadcast connection [{$name}] is not defined.\");\n        }\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            throw new InvalidArgumentException(\"Driver [{$config['driver']}] is not supported.\");\n        }\n\n        try {\n            return $this->{$driverMethod}($config);\n        } catch (Throwable $e) {\n            throw new RuntimeException(\"Failed to create broadcaster for connection \\\"{$name}\\\" with error: {$e->getMessage()}.\", 0, $e);\n        }\n    }","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/laravel/framework/blob/e0f6eb3518ac29fbbca8529e97d0df7fc9f24481/src/Illuminate/Broadcasting/BroadcastManager.php#L285-L321","documentation":"Thrown by BroadcastManager::resolve() when getConfig($name) returns null — no connection entry exists in config/broadcasting.php under 'connections' for the requested name. Broadcasting connections (pusher, redis, ably, log, null) are resolved by name before a driver method is dispatched.","triggerScenarios":"Calling Broadcast::connection($name) / Broadcast::driver($name), or referencing a connection in a broadcaster config, where $name is absent from 'connections'; using the default connection when 'default' points at an undeclared key.","commonSituations":"Setting BROADCAST_CONNECTION env to a value not present in 'connections' (e.g. 'pusher' while the config uses 'reverb'); renaming a connection; config cache predating the change; package (Reverb/Soketi) config not published.","solutions":["Add the connection to config/broadcasting.php 'connections' with the proper driver and credentials.","Set BROADCAST_CONNECTION (and 'default') to a connection key that exists.","Publish/merge the broadcasting config of the package you use (e.g. php artisan vendor:publish for Reverb).","Run php artisan config:clear to drop a stale cached config."],"exampleFix":"// before\n// .env: BROADCAST_CONNECTION=reverb\n// config/broadcasting.php 'connections' => ['pusher' => [...], 'log' => [...]]\n\n// after\n// config/broadcasting.php\n'connections' => [\n    'pusher' => [...],\n    'reverb' => [\n        'driver' => 'reverb',\n        'key' => env('REVERB_APP_KEY'),\n        'secret' => env('REVERB_APP_SECRET'),\n        'app_id' => env('REVERB_APP_ID'),\n        'options' => ['host' => env('REVERB_HOST'), 'port' => env('REVERB_PORT'), 'scheme' => env('REVERB_SCHEME')],\n    ],\n    'log' => [...],\n],","handlingStrategy":"validation","validationCode":"// PHP — confirm the connection exists before resolving\nif (! is_array(config(\"broadcasting.connections.{$name}\"))) {\n    abort(500, \"Broadcast connection [{$name}] is not configured.\");\n}\nBroadcast::connection($name);","typeGuard":"function broadcastConnectionIsDefined(string $name): bool {\n    return is_array(config(\"broadcasting.connections.{$name}\"));\n}","tryCatchPattern":"try {\n    Broadcast::driver($name);\n} catch (\\InvalidArgumentException $e) {\n    report('Unknown broadcast connection: '.$e->getMessage());\n    throw $e;\n}","preventionTips":["Declare connections under broadcasting.php 'connections'.","Keep BROADCAST_CONNECTION pointed at a declared key.","Publish package broadcasting configs and clear the config cache."],"tags":["broadcasting","laravel","configuration"],"backgroundTag":null,"analyzedSha":"e0f6eb3518ac29fbbca8529e97d0df7fc9f24481","analyzedAt":"2026-08-11T20:52:37.562Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}