File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 30
30
class Initializer
31
31
{
32
32
33
+ /**
34
+ * @var bool
35
+ */
33
36
private static bool $ initialized = false ;
34
37
35
38
/**
Original file line number Diff line number Diff line change @@ -22,6 +22,24 @@ public static function install(): void
22
22
copy (__DIR__ . '/config/database.php ' , $ database_file );
23
23
}
24
24
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
+ }
25
43
}
26
44
27
45
/**
@@ -69,5 +87,5 @@ public static function uninstallByRelation(): void
69
87
remove_dir ($ path );
70
88
}
71
89
}
72
-
90
+
73
91
}
You can’t perform that action at this time.
0 commit comments