2
2
3
3
namespace BeyondCode \LaravelWebSockets ;
4
4
5
- use BeyondCode \LaravelWebSockets \PubSub \Broadcasters \RedisPusherBroadcaster ;
6
- use BeyondCode \LaravelWebSockets \PubSub \Drivers \EmptyClient ;
7
- use BeyondCode \LaravelWebSockets \PubSub \Drivers \RedisClient ;
8
- use BeyondCode \LaravelWebSockets \PubSub \ReplicationInterface ;
9
5
use Pusher \Pusher ;
10
6
use Psr \Log \LoggerInterface ;
11
7
use Illuminate \Support \Facades \Gate ;
14
10
use Illuminate \Broadcasting \BroadcastManager ;
15
11
use BeyondCode \LaravelWebSockets \Server \Router ;
16
12
use BeyondCode \LaravelWebSockets \Apps \AppProvider ;
13
+ use BeyondCode \LaravelWebSockets \PubSub \Drivers \EmptyClient ;
14
+ use BeyondCode \LaravelWebSockets \PubSub \Drivers \RedisClient ;
15
+ use BeyondCode \LaravelWebSockets \PubSub \ReplicationInterface ;
17
16
use BeyondCode \LaravelWebSockets \WebSockets \Channels \ChannelManager ;
18
17
use BeyondCode \LaravelWebSockets \Dashboard \Http \Controllers \SendMessage ;
19
18
use BeyondCode \LaravelWebSockets \Dashboard \Http \Controllers \ShowDashboard ;
19
+ use BeyondCode \LaravelWebSockets \PubSub \Broadcasters \RedisPusherBroadcaster ;
20
20
use BeyondCode \LaravelWebSockets \Dashboard \Http \Controllers \AuthenticateDashboard ;
21
21
use BeyondCode \LaravelWebSockets \Dashboard \Http \Controllers \DashboardApiController ;
22
22
use BeyondCode \LaravelWebSockets \WebSockets \Channels \ChannelManagers \ArrayChannelManager ;
@@ -29,36 +29,36 @@ class WebSocketsServiceProvider extends ServiceProvider
29
29
public function boot ()
30
30
{
31
31
$ this ->publishes ([
32
- __DIR__ . '/../config/websockets.php ' => base_path ('config/websockets.php ' ),
32
+ __DIR__ . '/../config/websockets.php ' => base_path ('config/websockets.php ' ),
33
33
], 'config ' );
34
34
35
- if (!class_exists ('CreateWebSocketsStatisticsEntries ' )) {
35
+ if (! class_exists ('CreateWebSocketsStatisticsEntries ' )) {
36
36
$ this ->publishes ([
37
- __DIR__ . '/../database/migrations/create_websockets_statistics_entries_table.php.stub ' => database_path ('migrations/ ' . date ('Y_m_d_His ' , time ()) . '_create_websockets_statistics_entries_table.php ' ),
37
+ __DIR__ . '/../database/migrations/create_websockets_statistics_entries_table.php.stub ' => database_path ('migrations/ ' . date ('Y_m_d_His ' , time ()). '_create_websockets_statistics_entries_table.php ' ),
38
38
], 'migrations ' );
39
39
}
40
40
41
41
$ this
42
42
->registerRoutes ()
43
43
->registerDashboardGate ();
44
44
45
- $ this ->loadViewsFrom (__DIR__ . '/../resources/views/ ' , 'websockets ' );
45
+ $ this ->loadViewsFrom (__DIR__ . '/../resources/views/ ' , 'websockets ' );
46
46
47
47
$ this ->commands ([
48
48
Console \StartWebSocketServer::class,
49
49
Console \CleanStatistics::class,
50
50
]);
51
51
52
52
$ this ->configurePubSub ();
53
-
54
53
}
55
54
56
55
protected function configurePubSub ()
57
56
{
58
57
if (config ('websockets.replication.enabled ' ) !== true || config ('websockets.replication.driver ' ) !== 'redis ' ) {
59
58
$ this ->app ->singleton (ReplicationInterface::class, function () {
60
- return ( new EmptyClient () );
59
+ return new EmptyClient ();
61
60
});
61
+
62
62
return ;
63
63
}
64
64
@@ -87,7 +87,7 @@ protected function configurePubSub()
87
87
88
88
public function register ()
89
89
{
90
- $ this ->mergeConfigFrom (__DIR__ . '/../config/websockets.php ' , 'websockets ' );
90
+ $ this ->mergeConfigFrom (__DIR__ . '/../config/websockets.php ' , 'websockets ' );
91
91
92
92
$ this ->app ->singleton ('websockets.router ' , function () {
93
93
return new Router ();
0 commit comments