1313use BeyondCode \LaravelWebSockets \Statistics \Http \Middleware \Authorize as AuthorizeStatistics ;
1414use BeyondCode \LaravelWebSockets \WebSockets \Channels \ChannelManager ;
1515use BeyondCode \LaravelWebSockets \WebSockets \Channels \ChannelManagers \ArrayChannelManager ;
16- use Illuminate \Database \QueryException ;
1716use Illuminate \Support \Facades \Gate ;
1817use Illuminate \Support \Facades \Route ;
19- use Illuminate \Support \Facades \Schema ;
2018use Illuminate \Support \ServiceProvider ;
2119
2220class WebSocketsServiceProvider extends ServiceProvider
@@ -27,30 +25,21 @@ public function boot()
2725 __DIR__ .'/../config/websockets.php ' => base_path ('config/websockets.php ' ),
2826 ], 'config ' );
2927
30- try {
31- if (! Schema::hasTable ('websockets_statistics_entries ' )) {
32- $ this ->publishes ([
33- __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 ' ),
34- ], 'migrations ' );
35- }
36-
37- $ this
38- ->registerRoutes ()
39- ->registerDashboardGate ();
40-
41- $ this ->loadViewsFrom (__DIR__ .'/../resources/views/ ' , 'websockets ' );
42-
43- $ this ->commands ([
44- Console \StartWebSocketServer::class,
45- Console \CleanStatistics::class,
46- Console \RestartWebSocketServer::class,
47- ]);
48- } catch (QueryException $ e ) {
49- // Exception raised by composer update
50- // Usually happens when doing on CI where no DB exists at start
51- // Either way if DB connection not obtained
52- // Catching and doing nothing is ignore for composer update
53- }
28+ $ this ->publishes ([
29+ __DIR__ .'/../database/migrations/create_websockets_statistics_entries_table.php.stub ' => database_path ('migrations/ ' .'000000_create_websockets_statistics_entries_table.php ' ),
30+ ], 'migrations ' );
31+
32+ $ this
33+ ->registerRoutes ()
34+ ->registerDashboardGate ();
35+
36+ $ this ->loadViewsFrom (__DIR__ .'/../resources/views/ ' , 'websockets ' );
37+
38+ $ this ->commands ([
39+ Console \StartWebSocketServer::class,
40+ Console \CleanStatistics::class,
41+ Console \RestartWebSocketServer::class,
42+ ]);
5443 }
5544
5645 public function register ()
0 commit comments