add back the github branch (#812)

This commit is contained in:
Dennis 2023-05-05 12:00:46 +02:00 committed by GitHub
commit 59c04edf90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,5 +75,19 @@ class AppServiceProvider extends ServiceProvider
$settings = $this->app->make(MailSettings::class);
$settings->setConfig();
try {
$stringfromfile = file(base_path() . '/.git/HEAD');
$firstLine = $stringfromfile[0]; //get the string from the array
$explodedstring = explode('/', $firstLine, 3); //seperate out by the "/" in the string
$branchname = $explodedstring[2]; //get the one that is always the branch name
} catch (Exception $e) {
$branchname = 'unknown';
Log::notice($e);
}
config(['BRANCHNAME' => $branchname]);
}
}