{"id":"069e3ed10b9d9141","repo":"laravel/framework","slug":"queue-resolver-did-not-return-a-queue-implementati","errorCode":null,"errorMessage":"Queue resolver did not return a Queue implementation.","messagePattern":"Queue resolver did not return a Queue implementation\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Bus/Dispatcher.php","lineNumber":269,"sourceCode":"\n    /**\n     * Dispatch a command to its appropriate handler behind a queue.\n     *\n     * @param  mixed  $command\n     * @return mixed\n     *\n     * @throws \\RuntimeException\n     */\n    public function dispatchToQueue($command)\n    {\n        $connection = $this->getAttributeValue($command, Connection::class, 'connection')\n            ?? $this->resolveConnectionFromQueueRoute($command)\n            ?? null;\n\n        $queue = ($this->queueResolver)($connection);\n\n        if (! $queue instanceof Queue) {\n            throw new RuntimeException('Queue resolver did not return a Queue implementation.');\n        }\n\n        if (method_exists($command, 'queue')) {\n            return $command->queue($queue, $command);\n        }\n\n        return $this->pushCommandToQueue($queue, $command);\n    }\n\n    /**\n     * Push the command onto the given queue instance.\n     *\n     * @param  \\Illuminate\\Contracts\\Queue\\Queue  $queue\n     * @param  mixed  $command\n     * @return mixed\n     */\n    protected function pushCommandToQueue($queue, $command)\n    {","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Bus/Dispatcher.php#L251-L287","documentation":"Bus\\Dispatcher::dispatchToQueue() invokes the queueResolver closure to obtain a Queue implementation for the job's connection; if the returned value is not an instance of Illuminate\\Contracts\\Queue\\Queue it throws this RuntimeException. It guards against a misconfigured or missing queue manager binding.","triggerScenarios":"Dispatching a job that implements ShouldQueue when the queue resolver callback returns null or an invalid object. Occurs when the illuminate/queue package is not wired into the container, when a custom queue resolver was mis-set, or in a minimal (non-Framework) Illuminate install without QueueServiceProvider.","commonSituations":"Using illuminate/bus standalone without illuminate/queue installed/registered. A test or console kernel that does not boot the QueueServiceProvider. Manually constructing a Bus\\Dispatcher with a broken queueResolver closure.","solutions":["Install and register illuminate/queue (require the package and run QueueServiceProvider) so the resolver returns a Queue instance.","If running the full Laravel framework, ensure the QueueServiceProvider is registered in config/app.php and not removed.","Check that the queue connection (QUEUE_CONNECTION) in config/queue.php resolves to a real driver (sync/database/redis/etc.).","If building a custom container binding, ensure the 'queue' binding returns an object implementing Illuminate\\Contracts\\Queue\\Queue."],"exampleFix":"// before (standalone, queue not wired)\n$dispatcher = new \\Illuminate\\Bus\\Dispatcher($container);\n$dispatcher->dispatch(new ShouldQueueJob());\n\n// after\nuse Illuminate\\Queue\\QueueServiceProvider;\n(new QueueServiceProvider($app))->register();\n$dispatcher = new \\Illuminate\\Bus\\Dispatcher($app, function ($connection) use ($app) {\n    return $app['queue']->connection($connection);\n});","handlingStrategy":"validation","validationCode":"if (! app()->bound('queue') || ! app('queue') instanceof \\Illuminate\\Contracts\\Queue\\Queue) {\n    throw new \\RuntimeException('Queue manager not bound; cannot dispatch queued jobs.');\n}\n// or check the package\nif (! class_exists(\\Illuminate\\Queue\\CallQueuedClosure::class)) {\n    throw new \\RuntimeException('illuminate/queue is required for queued jobs.');\n}","typeGuard":"function queueIsConfigured(): bool\n{\n    return app()->bound('queue')\n        && interface_exists(\\Illuminate\\Contracts\\Queue\\Queue::class)\n        && config('queue.default') !== null;\n}","tryCatchPattern":"try {\n    $dispatcher->dispatch($command);\n} catch (\\RuntimeException $e) {\n    if ($e->getMessage() === 'Queue resolver did not return a Queue implementation.') {\n        // install/register illuminate/queue then retry\n    }\n    throw $e;\n}","preventionTips":["Always pair illuminate/bus with illuminate/queue in composer.json.","Register QueueServiceProvider in service providers.","Assert QUEUE_CONNECTION is set in .env.example.","Test dispatch paths in CI to catch wiring regressions."],"tags":["bus","queue","configuration","ioc-container"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}