From c892efe2898abe09fa9d9f4238112b1e310ae8e8 Mon Sep 17 00:00:00 2001 From: Jens Twesmann Date: Tue, 19 Mar 2024 10:04:48 +0100 Subject: [PATCH] fixed #128 - check if l11 with new skeleton is used respects old file pattern on updated l11 installations --- src/Commands/InstallCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index 5f17f5d..176ad0d 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -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')); @@ -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},",