The Router provides a good way to do kind or URL routing for websockets.
The library depends on cboden/ratchet which is the WebSocket server used but feel free
to write the same for other WebSocket servers.
The library works based on the fields path given in the JSON message. All the configuration
is done via the router.php file published.
The library handles Middlewares, Prefixes namespaces in grouping similarly to Laravel 5 URL routing.
Require Calen/router in your L5 project.
I used PHP7 to write it, so it has a dependency on it.
composer require calen/router
Then add the Service Provider in the providers in L5 config/app.php: