To install as a Composer package to be used with Laravel 5, simply run:
composer require "enniel/wampeer"
Once it's installed, you can register the service provider in config/app.php
in the providers
array:
'providers' => [
\Enniel\Wampeer\Providers\WampeerServiceProvider::class,
]
You can use the facade for shorter code. Add this to your aliases:
'aliases' => [
'WampRouter' => \Enniel\Wampeer\Facades\Router::class,
]
Then publish assets with php artisan vendor:publish
. This will add the file config/wampeer.php
.
Set up code in the boot method at your provider
WampRouter::registerModules([
// Websocket listener
new RatchetTransportProvider(),
// Rawsocket listener
new RawSocketTransportProvider(),
]);
WampRouter::addInternalClient(new SimpleAuthProviderClient(["testSimpleAuthRealm", "authful_realm"]));