Skip to content

Commit

Permalink
fixed spatie#128 - check if l11 with new skeleton is used
Browse files Browse the repository at this point in the history
respects old file pattern on updated l11 installations
  • Loading branch information
Jens Twesmann committed Mar 19, 2024
1 parent 6349e39 commit c892efe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected function copyServiceProviderInApp(): self

$namespace = Str::replaceLast('\\', '', $this->laravel->getNamespace());

if (intval(app()->version()) < 11) {
if (intval(app()->version()) < 11 || !file_exists(base_path('bootstrap/providers.php'))) {
$appConfig = file_get_contents(config_path('app.php'));
} else {
$appConfig = file_get_contents(base_path('bootstrap/providers.php'));
Expand All @@ -174,7 +174,7 @@ protected function copyServiceProviderInApp(): self
return $this;
}

if (intval(app()->version()) < 11) {
if (intval(app()->version()) < 11 || !file_exists(base_path('bootstrap/providers.php'))) {
file_put_contents(config_path('app.php'), str_replace(
"{$namespace}\\Providers\\BroadcastServiceProvider::class,",
"{$namespace}\\Providers\\BroadcastServiceProvider::class," . PHP_EOL . " {$namespace}{$class},",
Expand Down

0 comments on commit c892efe

Please sign in to comment.