2018-11-20 10:32:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace BeyondCode\LaravelWebSockets;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
2018-11-21 11:13:40 +00:00
|
|
|
use BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Channels\ChannelManager;
|
2018-11-20 10:32:56 +00:00
|
|
|
|
|
|
|
|
class LaravelWebSocketsServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
public function boot()
|
|
|
|
|
{
|
2018-11-22 22:55:39 +00:00
|
|
|
$this->publishes([
|
|
|
|
|
__DIR__.'/../config/config.php' => base_path('config/websockets.php'),
|
|
|
|
|
], 'config');
|
|
|
|
|
|
2018-11-20 10:51:00 +00:00
|
|
|
$this->commands([
|
|
|
|
|
Console\StartWebSocketServer::class,
|
|
|
|
|
]);
|
2018-11-20 10:32:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function register()
|
|
|
|
|
{
|
2018-11-22 22:55:39 +00:00
|
|
|
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'websockets');
|
|
|
|
|
|
2018-11-20 10:32:56 +00:00
|
|
|
$this->app->singleton('websockets.router', function() {
|
|
|
|
|
return new Router();
|
|
|
|
|
});
|
2018-11-21 23:25:24 +00:00
|
|
|
|
2018-11-21 11:13:40 +00:00
|
|
|
$this->app->singleton(ChannelManager::class, function() {
|
|
|
|
|
return new ChannelManager();
|
|
|
|
|
});
|
2018-11-20 10:32:56 +00:00
|
|
|
}
|
|
|
|
|
}
|