From d01860c879afb06813ee02dc81bd15f8daf322a4 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Thu, 14 Mar 2024 14:20:24 +0000 Subject: [PATCH] [1.x] Fixes install command for applications migrated from 10.x to 11.x (#84) * wip * wip --- src/Console/Commands/InstallCommand.php | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/Console/Commands/InstallCommand.php b/src/Console/Commands/InstallCommand.php index 7dcc7f81..b37c1844 100644 --- a/src/Console/Commands/InstallCommand.php +++ b/src/Console/Commands/InstallCommand.php @@ -97,10 +97,6 @@ protected function publishConfiguration(): void */ protected function updateBroadcastingConfiguration(): void { - if (! $this->isLaravelTen()) { - return; - } - if ($this->laravel->config->has('broadcasting.connections.reverb')) { return; } @@ -136,6 +132,8 @@ protected function updateBroadcastingConfiguration(): void */ protected function enableBroadcasting(): void { + $this->enableBroadcastServiceProvider(); + if (File::exists(base_path('routes/channels.php'))) { return; } @@ -146,13 +144,9 @@ protected function enableBroadcasting(): void return; } - if ($this->isLaravelTen()) { - $this->enableBroadcastServiceProvider(); - - return; + if ($this->getApplication()->has('install:broadcasting')) { + $this->call('install:broadcasting', ['--no-interaction' => true]); } - - $this->callSilently('install:broadcasting'); } /** @@ -189,12 +183,4 @@ protected function updateBroadcastingDriver(): void }) ); } - - /** - * Determine if the application is using Laravel 10. - */ - protected function isLaravelTen(): bool - { - return version_compare($this->laravel->version(), '11.0', '<'); - } }