Skip to content

Commit d3376e1

Browse files
Install Broadcasting Command Fix for Livewire Starter Kit (#55774)
* fix for livewire starter kit * remove whitespace * minimal style change * Update BroadcastingInstallCommand.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent fba3b98 commit d3376e1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@ public function handle()
116116
trim($bootstrapScript.PHP_EOL.file_get_contents(__DIR__.'/stubs/echo-bootstrap-js.stub')).PHP_EOL,
117117
);
118118
}
119+
} elseif (file_exists($appScriptPath = $this->laravel->resourcePath('js/app.js'))) {
120+
// If no bootstrap.js, try app.js...
121+
$appScript = file_get_contents(
122+
$appScriptPath
123+
);
124+
125+
if (! str_contains($appScript, './echo')) {
126+
file_put_contents(
127+
$appScriptPath,
128+
trim($appScript.PHP_EOL.file_get_contents(__DIR__.'/stubs/echo-bootstrap-js.stub')).PHP_EOL,
129+
);
130+
}
119131
}
120132
}
121133

0 commit comments

Comments
 (0)