This commit is contained in:
Fabian @ Blax Software 2026-01-26 11:52:53 +01:00
parent 935bfb28d3
commit 61d4eb282e
1 changed files with 8 additions and 0 deletions

View File

@ -450,10 +450,18 @@ class StartServer extends Command
* - Caches discovered controllers in memory for O(1) lookup * - Caches discovered controllers in memory for O(1) lookup
* - Supports folder-based controllers (e.g., Admin/UserController) * - Supports folder-based controllers (e.g., Admin/UserController)
* *
* NOTE: Skipped when hot_reload is enabled to allow code changes without restart.
*
* @return void * @return void
*/ */
protected function preloadControllers(): void protected function preloadControllers(): void
{ {
// Skip preloading when hot_reload is enabled - this allows code changes without restart
if (config('websockets.hot_reload', false)) {
\Log::channel('websocket')->debug('Controller preloading skipped (hot_reload enabled)');
return;
}
// Use ControllerResolver to scan and cache all controllers // Use ControllerResolver to scan and cache all controllers
\BlaxSoftware\LaravelWebSockets\Websocket\ControllerResolver::preload(); \BlaxSoftware\LaravelWebSockets\Websocket\ControllerResolver::preload();