Skip to content

Commit

Permalink
remove support/bootstrap/LaravelDb
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed Feb 7, 2025
1 parent 56dc98c commit c27f61e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Install
public static function install()
{
static::installByRelation();
static::removeLaravelDbFromBootstrap();
}

/**
Expand Down Expand Up @@ -57,4 +58,21 @@ public static function installByRelation()
}
}

/**
* @return void
*/
protected static function removeLaravelDbFromBootstrap(): void
{
$file = base_path('config/bootstrap.php');
if (!is_file($file)) {
return;
}
$pattern = '/^\s*support\\\\bootstrap\\\\LaravelDb::class,?\s*?\r?\n/m';
$content = file_get_contents($file);
if (preg_match($pattern, $content)) {
$updatedContent = preg_replace($pattern, '', $content);
file_put_contents($file, $updatedContent);
}
}

}

0 comments on commit c27f61e

Please sign in to comment.