diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dfce481..dc3fbf5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,10 +31,7 @@ jobs: php-version: 8.2 - name: Configure Composer - env: - TEMP_ENV: ${{ SECRETS.TEMP_ENV }} run: | - printf "%s" "$TEMP_ENV" > ".env" composer update composer install --optimize-autoloader --no-dev --no-interaction --prefer-dist diff --git a/app/Providers/ConfigUpdaterProvider.php b/app/Providers/ConfigUpdaterProvider.php index 14204cf..979da4b 100644 --- a/app/Providers/ConfigUpdaterProvider.php +++ b/app/Providers/ConfigUpdaterProvider.php @@ -23,15 +23,15 @@ public function boot(): void { $dataTable = DB::table('settings')->pluck('value', 'name')->toArray(); config([ - "variables.templateName" => $dataTable['siteName'], - "variables.templateSuffix" => $dataTable['suffix'], - "variables.templateDescription" => $dataTable['templateDescription'], - "variables.support_mail" => $dataTable['support_mail'], - "variables.url" => $dataTable['url'], - "variables.templateKeyword" => $dataTable['templateKeyword'], - "variables.facebookUrl" => $dataTable['facebookUrl'], - "variables.twitterUrl" => $dataTable['twitterUrl'], - "variables.instagramUrl" => $dataTable['instagramUrl'], + "variables.templateName" => empty($dataTable['siteName']) ? config('variables.templateName') : $dataTable['siteName'], + "variables.templateSuffix" => empty($dataTable['suffix']) ? config('variables.templateSuffix') : $dataTable['suffix'], + "variables.templateDescription" => empty($dataTable['templateDescription']) ? config('variables.templateDescription') : $dataTable['templateDescription'], + "variables.support_mail" => empty($dataTable['support_mail']) ? config('variables.support_mail') : $dataTable['support_mail'], + "variables.url" => empty($dataTable['url']) ? config('variables.url') : $dataTable['url'], + "variables.templateKeyword" => empty($dataTable['templateKeyword']) ? config('variables.templateKeyword') : $dataTable['templateKeyword'], + "variables.facebookUrl" => empty($dataTable['facebookUrl']) ? config('variables.facebookUrl') : $dataTable['facebookUrl'], + "variables.twitterUrl" => empty($dataTable['twitterUrl']) ? config('variables.twitterUrl') : $dataTable['twitterUrl'], + "variables.instagramUrl" => empty($dataTable['instagramUrl']) ? config('variables.instagramUrl') : $dataTable['instagramUrl'], ]); } }