File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 3030class Initializer
3131{
3232
33+ /**
34+ * @var bool
35+ */
3336 private static bool $ initialized = false ;
3437
3538 /**
Original file line number Diff line number Diff line change @@ -22,6 +22,24 @@ public static function install(): void
2222 copy (__DIR__ . '/config/database.php ' , $ database_file );
2323 }
2424 static ::installByRelation ();
25+ static ::removeLaravelDbFromBootstrap ();
26+ }
27+
28+ /**
29+ * @return void
30+ */
31+ protected static function removeLaravelDbFromBootstrap (): void
32+ {
33+ $ file = base_path ('config/bootstrap.php ' );
34+ if (!is_file ($ file )) {
35+ return ;
36+ }
37+ $ pattern = '/^\s*support \\\\bootstrap \\\\LaravelDb::class,\s*?\r?\n/m ' ;
38+ $ content = file_get_contents ($ file );
39+ if (preg_match ($ pattern , $ content )) {
40+ $ updatedContent = preg_replace ($ pattern , '' , $ content );
41+ file_put_contents ($ file , $ updatedContent );
42+ }
2543 }
2644
2745 /**
@@ -69,5 +87,5 @@ public static function uninstallByRelation(): void
6987 remove_dir ($ path );
7088 }
7189 }
72-
90+
7391}
You can’t perform that action at this time.
0 commit comments