{"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/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Broadcasting/BroadcastManager.php#L285-L321","documentation":"Thrown by BroadcastManager::resolve() when getConfig($name) returns null, meaning there is no 'broadcasting.connections.{name}' entry in config/broadcasting.php and $name is not 'null'.","triggerScenarios":"Calling Broadcast::connection('reverb') when 'reverb' is absent from broadcasting.connections; an event whose $connection property references an undefined connection; BROADCAST_CONNECTION env pointing to a removed entry.","commonSituations":"Switching broadcast backends without publishing the config; installing a Reverb/Laravel WebSockets package whose config was not published; typo in the connection name on an event class.","solutions":["Add the connection under 'connections' in config/broadcasting.php with a valid driver and credentials.","Set BROADCAST_CONNECTION (or broadcasting.default) to a connection that exists.","Verify the $connection property on ShouldBroadcast events references an existing connection name.","Run php artisan config:clear after editing."],"exampleFix":"// before - config/broadcasting.php\n'connections' => [\n    'pusher' => [...],\n],\n// BROADCAST_CONNECTION=reverb -> throws\n\n// after\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')],\n    ],\n],","handlingStrategy":"validation","validationCode":"$connection = 'reverb';\nif (is_null(config(\"broadcasting.connections.{$connection}\"))) {\n    throw new RuntimeException(\"Broadcast connection [{$connection}] is not configured.\");\n}\nBroadcast::connection($connection);","typeGuard":"function broadcastConnectionIsConfigured(string $name): bool\n{\n    return ! is_null(config(\"broadcasting.connections.{$name}\"));\n}","tryCatchPattern":"try {\n    Broadcast::connection($name);\n} catch (\\InvalidArgumentException $e) {\n    // fall back to default/null connection or abort with config error\n}","preventionTips":["Define every connection referenced by events under broadcasting.connections.","Set broadcasting.default to a connection that exists; verify BROADCAST_CONNECTION env.","Publish and review package broadcast configs before referencing them."],"tags":["broadcasting","configuration","connection","laravel"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}