{"id":"6608238bb55486a0","repo":"laravel/framework","slug":"unable-to-resolve-the-dispatcher-from-the-service","errorCode":null,"errorMessage":"Unable to resolve the dispatcher from the service container. Please bind it or install the illuminate/bus package.","messagePattern":"Unable to resolve the dispatcher from the service container\\. Please bind it or install the illuminate/bus package\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Console/Scheduling/Schedule.php","lineNumber":496,"sourceCode":"        }\n\n        return $this;\n    }\n\n    /**\n     * Get the job dispatcher, if available.\n     *\n     * @return \\Illuminate\\Contracts\\Bus\\Dispatcher\n     *\n     * @throws \\RuntimeException\n     */\n    protected function getDispatcher()\n    {\n        if ($this->dispatcher === null) {\n            try {\n                $this->dispatcher = Container::getInstance()->make(Dispatcher::class);\n            } catch (BindingResolutionException $e) {\n                throw new RuntimeException(\n                    'Unable to resolve the dispatcher from the service container. Please bind it or install the illuminate/bus package.',\n                    is_int($e->getCode()) ? $e->getCode() : 0, $e\n                );\n            }\n        }\n\n        return $this->dispatcher;\n    }\n\n    /**\n     * Indicate that the scheduler should not poll for pause or interrupt signals.\n     *\n     * This prevents the scheduler from hitting the application cache to determine if it needs to pause or interrupt.\n     *\n     * @return void\n     */\n    public static function withoutInterruptionPolling()\n    {","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Console/Scheduling/Schedule.php#L478-L514","documentation":"Thrown by Schedule::getDispatcher() (src/Illuminate/Console/Scheduling/Schedule.php:496) when Container::getInstance()->make(Dispatcher::class) raises BindingResolutionException. Scheduled jobs need an illuminate/bus Dispatcher to send ShouldQueue jobs; without it the chain catches and re-throws a clearer message.","triggerScenarios":"Schedule::job(SomeJob) (a queued job) in a project where the bus dispatcher isn't bound. Common with minimal illuminate/console + illuminate/queue setups that omit illuminate/bus, or where BusServiceProvider wasn't registered.","commonSituations":"Sub-framework setups, custom service providers that forget to register Illuminate\\Bus\\BusServiceProvider, or removed illuminate/bus from composer.json.","solutions":["composer require illuminate/bus.","Register Illuminate\\Bus\\BusServiceProvider (or register the Dispatcher binding manually).","If queueing isn't needed, run jobs synchronously by ensuring they do not implement ShouldQueue.","Re-run composer dump-autoload after installing."],"exampleFix":"// before\n// composer.json omits illuminate/bus\n$schedule->job(SyncJob::class)->hourly();  // SyncJob implements ShouldQueue\n\n// after\n// composer require illuminate/bus\n// bootstrap: $app->register(Illuminate\\Bus\\BusServiceProvider::class);\n$schedule->job(SyncJob::class)->hourly();","handlingStrategy":"validation","validationCode":"if (! \\Illuminate\\Container\\Container::getInstance()->bound(\\Illuminate\\Contracts\\Bus\\Dispatcher::class)) {\n    // install illuminate/bus or bind the dispatcher before scheduling queued jobs\n}","typeGuard":"function dispatcherBound(): bool\n{\n    return \\Illuminate\\Container\\Container::getInstance()->bound(\\Illuminate\\Contracts\\Bus\\Dispatcher::class);\n}","tryCatchPattern":"try {\n    $schedule->job(QueuedJob::class)->hourly();\n} catch (\\RuntimeException $e) {\n    // install illuminate/bus, register BusServiceProvider, then retry\n}","preventionTips":["Register Illuminate\\Bus\\BusServiceProvider in your bootstrap.","Verify dispatcher binding in a boot-time health check.","Don't schedule ShouldQueue jobs without a bound bus dispatcher."],"tags":["scheduling","queue","dependency","composer","laravel"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}