13
13
use BeyondCode \LaravelWebSockets \Statistics \Http \Middleware \Authorize as AuthorizeStatistics ;
14
14
use BeyondCode \LaravelWebSockets \WebSockets \Channels \ChannelManager ;
15
15
use BeyondCode \LaravelWebSockets \WebSockets \Channels \ChannelManagers \ArrayChannelManager ;
16
- use Illuminate \Database \QueryException ;
17
16
use Illuminate \Support \Facades \Gate ;
18
17
use Illuminate \Support \Facades \Route ;
19
- use Illuminate \Support \Facades \Schema ;
20
18
use Illuminate \Support \ServiceProvider ;
21
19
22
20
class WebSocketsServiceProvider extends ServiceProvider
@@ -27,30 +25,21 @@ public function boot()
27
25
__DIR__ .'/../config/websockets.php ' => base_path ('config/websockets.php ' ),
28
26
], 'config ' );
29
27
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
+ ]);
54
43
}
55
44
56
45
public function register ()
0 commit comments