Skip to content

Commit c27f61e

Browse files
committed
remove support/bootstrap/LaravelDb
1 parent 56dc98c commit c27f61e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/Install.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Install
2222
public static function install()
2323
{
2424
static::installByRelation();
25+
static::removeLaravelDbFromBootstrap();
2526
}
2627

2728
/**
@@ -57,4 +58,21 @@ public static function installByRelation()
5758
}
5859
}
5960

61+
/**
62+
* @return void
63+
*/
64+
protected static function removeLaravelDbFromBootstrap(): void
65+
{
66+
$file = base_path('config/bootstrap.php');
67+
if (!is_file($file)) {
68+
return;
69+
}
70+
$pattern = '/^\s*support\\\\bootstrap\\\\LaravelDb::class,?\s*?\r?\n/m';
71+
$content = file_get_contents($file);
72+
if (preg_match($pattern, $content)) {
73+
$updatedContent = preg_replace($pattern, '', $content);
74+
file_put_contents($file, $updatedContent);
75+
}
76+
}
77+
6078
}

0 commit comments

Comments
 (0)