From 5da7bbaf81df37be120e630ba0b8a2b3e561612a Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Wed, 19 Jun 2024 20:52:59 +0100 Subject: [PATCH] [5.x] Ensure `install:broadcasting` is run when installing into Laravel 11 application (#10335) Co-authored-by: duncanmcclean --- src/Console/Commands/InstallCollaboration.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Console/Commands/InstallCollaboration.php b/src/Console/Commands/InstallCollaboration.php index a7e1981702..e4b4a46756 100644 --- a/src/Console/Commands/InstallCollaboration.php +++ b/src/Console/Commands/InstallCollaboration.php @@ -56,15 +56,15 @@ public function handle() protected function enableBroadcasting(): void { - if (in_array(\Illuminate\Broadcasting\BroadcastServiceProvider::class, array_keys(app()->getLoadedProviders()))) { - $this->components->warn('Broadcasting is already enabled.'); + if (version_compare(app()->version(), '11', '<')) { + $this->enableBroadcastServiceProvider(); + $this->components->info('Broadcasting enabled successfully.'); return; } - if (version_compare(app()->version(), '11', '<')) { - $this->enableBroadcastServiceProvider(); - $this->components->info('Broadcasting enabled successfully.'); + if (File::exists(config_path('broadcasting.php'))) { + $this->components->warn('Broadcasting is already enabled.'); return; }