Update WebSocketsServiceProvider.php

Use schema check instead of class name check.
This commit is contained in:
robindrost 2020-08-12 12:26:07 +02:00 committed by GitHub
parent 45d951c56b
commit 8285f6da17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChanne
use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema
class WebSocketsServiceProvider extends ServiceProvider class WebSocketsServiceProvider extends ServiceProvider
{ {
@ -25,7 +26,7 @@ class WebSocketsServiceProvider extends ServiceProvider
__DIR__.'/../config/websockets.php' => base_path('config/websockets.php'), __DIR__.'/../config/websockets.php' => base_path('config/websockets.php'),
], 'config'); ], 'config');
if (! class_exists('CreateWebSocketsStatisticsEntriesTable')) { if (!Schema::hasTable('websockets_statistics_entries'))
$this->publishes([ $this->publishes([
__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'), __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'),
], 'migrations'); ], 'migrations');