diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 5f9dd9ff..52a0eee5 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -107,12 +107,33 @@ class AppServiceProvider extends ServiceProvider Artisan::call('cache:clear'); } + + try { + Artisan::call('config:clear'); + Artisan::call('cache:clear'); + $stringfromfile = file(base_path().'/.git/HEAD'); + Log::debug(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::error($e); + } + config(['BranchName' => $branchname]); + + // Set Discord-API Config config(['services.discord.client_id' => config('SETTINGS::DISCORD:CLIENT_ID')]); config(['services.discord.client_secret' => config('SETTINGS::DISCORD:CLIENT_SECRET')]); } catch (Exception $e) { - error_log("Settings Error: Could not load settings from database"); - Log::error("Settings Error: Could not load settings from database"); + error_log("Settings Error: Could not load settings from database. The Installation probably is not done yet."); + error_log($e); + Log::error("Settings Error: Could not load settings from database. The Installation probably is not done yet."); + Log::error($e); } } } diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php index 55fa3ceb..446e039e 100644 --- a/resources/views/layouts/main.blade.php +++ b/resources/views/layouts/main.blade.php @@ -404,7 +404,7 @@ href="{{ url('/') }}">{{ env('APP_NAME', 'Laravel') }}. All rights reserved. Powered by ControlPanel. Version - {{ config('app')['version'] }} + {{ config('app')['version'] }} - {{config("BranchName")}}