You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
I'm trying to create a custom handler, my laravel-websocket current version is 2.0.0-beta.33.
app\MyCustomWebSocketHandler.php
namespace App;
use BeyondCode\LaravelWebSockets\Server\WebSocketHandler;
use Exception;
use Illuminate\Support\Facades\Log;
use Ratchet\ConnectionInterface;
use Ratchet\RFC6455\Messaging\MessageInterface;
use Ratchet\WebSocket\MessageComponentInterface;
class MyCustomWebSocketHandler extends WebSocketHandler
{
public function onOpen(ConnectionInterface $connection)
{
Log::info($connection->httpRequest);
}
}
In my routes/web.php I added the following
use App\MyCustomWebSocketHandler;
use BeyondCode\LaravelWebSockets\Facades\WebSocketRouter;
WebSocketRouter::get('/test', MyCustomWebSocketHandler::class);
But when I try to restart the websocket server, I get the following error:
Searching in the error in the issues page I found the #531, however it says that was fixed at beta.21, So I'd like to know if there is another workaround, or there is a step that I missed.
I even changed the WebSocketRouter::get('/test', MyCustomWebSocketHandler::class); to boot() in AppServiceProvider.php, but to no avail.