Skip to content

Commit cf604d2

Browse files
nunomaduroStyleCIBottaylorotwell
authored
[11.x] Improves broadcasting install (#50519)
* Improves broadcasting install * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]> Co-authored-by: Taylor Otwell <[email protected]>
1 parent bdd0acb commit cf604d2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public function handle()
4949
$this->components->info("Published 'channels' route file.");
5050

5151
copy(__DIR__.'/stubs/broadcasting-routes.stub', $broadcastingRoutesPath);
52-
53-
$this->uncommentChannelsRoutesFile();
5452
}
5553

54+
$this->uncommentChannelsRoutesFile();
55+
5656
// Install bootstrapping...
5757
if (! file_exists($echoScriptPath = $this->laravel->resourcePath('js/echo.js'))) {
5858
copy(__DIR__.'/stubs/echo-js.stub', $echoScriptPath);
@@ -63,7 +63,7 @@ public function handle()
6363
$bootstrapScriptPath
6464
);
6565

66-
if (! str_contains($bootstrapScript, '/echo')) {
66+
if (! str_contains($bootstrapScript, './echo')) {
6767
file_put_contents(
6868
$bootstrapScriptPath,
6969
trim($bootstrapScript.PHP_EOL.file_get_contents(__DIR__.'/stubs/echo-bootstrap-js.stub')).PHP_EOL,
@@ -93,6 +93,8 @@ protected function uncommentChannelsRoutesFile()
9393
'channels: ',
9494
$appBootstrapPath,
9595
);
96+
} elseif (str_contains($content, 'channels: ')) {
97+
return;
9698
} elseif (str_contains($content, 'commands: __DIR__.\'/../routes/console.php\',')) {
9799
(new Filesystem)->replaceInFile(
98100
'commands: __DIR__.\'/../routes/console.php\',',

0 commit comments

Comments
 (0)