Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit aced911

Browse files
author
Chaitali Sakhale
committed
Force migration to a fixed path
1 parent d2feddd commit aced911

File tree

1 file changed

+15
-26
lines changed

1 file changed

+15
-26
lines changed

src/WebSocketsServiceProvider.php

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
use BeyondCode\LaravelWebSockets\Statistics\Http\Middleware\Authorize as AuthorizeStatistics;
1414
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
1515
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager;
16-
use Illuminate\Database\QueryException;
1716
use Illuminate\Support\Facades\Gate;
1817
use Illuminate\Support\Facades\Route;
19-
use Illuminate\Support\Facades\Schema;
2018
use Illuminate\Support\ServiceProvider;
2119

2220
class 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

Comments
 (0)