Referring from :-
https://docs.beyondco.de/laravel-websockets/1.0/advanced-usage/custom-websocket-handlers.html
After adding
WebSocketsRouter::webSocket('/my-websocket', \App\MyCustomWebSocketHandler::class);
Getting error
Custom WebSocket Handlers - Class 'WebSocketsRouter' not found
Also referred to #21
But causing all other socket somehow (like redirect to MyCustomWebSocketHandler)
Yeah I ran into this today. I scoped the class name as a quick fix. Wondering if there's a step missing from the documentation? ๐ค
<?php
use BeyondCode\LaravelWebSockets\Facades\WebSocketsRouter;
WebSocketsRouter::webSocket('/my-websocket', \App\MyCustomWebSocketHandler::class);
@Sh3nl0ng Getting error -
Target [Symfony\Component\Console\Output\OutputInterface] is not instantiable while building [BeyondCode\LaravelWebSockets\Server\Logger\WebsocketsLogger].
Any updates?
@Sh3nl0ng Getting error -
Target [Symfony\Component\Console\Output\OutputInterface] is not instantiable while building [BeyondCode\LaravelWebSockets\Server\Logger\WebsocketsLogger].
Same issue in 2.0.0-beta.26
Does this seem like it's not run from the console?
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Illuminate\Contracts\Container\BindingResolutionException
Target [Symfony\Component\Console\Output\OutputInterface] is not instantiable while building [BeyondCode\LaravelWebSockets\Server\Loggers\WebSocketsLogger].
at D:\code\laravel-projects\laravel-vuetify\vendor\laravel\framework\src\Illuminate\Container\Container.php:1017
1013โ } else {
1014โ $message = "Target [$concrete] is not instantiable.";
1015โ }
1016โ
โ 1017โ throw new BindingResolutionException($message);
1018โ }
1019โ
1020โ /**
1021โ * Throw an exception for an unresolvable primitive.
1 D:\code\laravel-projects\laravel-vuetify\vendor\laravel\framework\src\Illuminate\Container\Container.php:818
Illuminate\Container\Container::notInstantiable("Symfony\Component\Console\Output\OutputInterface")
2 D:\code\laravel-projects\laravel-vuetify\vendor\laravel\framework\src\Illuminate\Container\Container.php:691
Illuminate\Container\Container::build("Symfony\Component\Console\Output\OutputInterface")
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
composer dump-autoload caused this error when defined custom websocket handler
Same issue in 2.0.0-beta.32
Actually there is no WebSocketsRouter Facade in 2.0 , only one without the 's' in BeyondCode\LaravelWebSockets\Facades so which is the correct one?
<?php use BeyondCode\LaravelWebSockets\Facades\WebSocketsRouter; WebSocketsRouter::webSocket('/my-websocket', \App\MyCustomWebSocketHandler::class);
Here it is the docs on custom handlers: https://github.com/beyondcode/laravel-websockets/blob/2.x/docs/advanced-usage/custom-websocket-handlers.md
This is the good facade: https://github.com/beyondcode/laravel-websockets/blob/2.x/src/Facades/WebSocketRouter.php
Most helpful comment
Yeah I ran into this today. I scoped the class name as a quick fix. Wondering if there's a step missing from the documentation? ๐ค