Skip to content

Commit

Permalink
[1.x] Fixes install command for applications migrated from 10.x to 11…
Browse files Browse the repository at this point in the history
….x (#84)

* wip

* wip
  • Loading branch information
joedixon authored Mar 14, 2024
1 parent f2afa07 commit d01860c
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/Console/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -136,6 +132,8 @@ protected function updateBroadcastingConfiguration(): void
*/
protected function enableBroadcasting(): void
{
$this->enableBroadcastServiceProvider();

if (File::exists(base_path('routes/channels.php'))) {
return;
}
Expand All @@ -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');
}

/**
Expand Down Expand Up @@ -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', '<');
}
}

0 comments on commit d01860c

Please sign in to comment.