From 8b8fa53665a29f235d104ffdad05608406918b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20Ioni=C8=9B=C4=83?= Date: Thu, 18 May 2023 15:27:42 +0300 Subject: [PATCH] chore: add about info --- app/Providers/AppServiceProvider.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 07f90df2..c8be33d6 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -5,10 +5,12 @@ namespace App\Providers; use App\Services\BlockCollection; +use App\Services\Features; use App\Services\SupportsTrait; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Foundation\Console\AboutCommand; use Illuminate\Pagination\Paginator; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Validator; @@ -73,6 +75,8 @@ public function boot() Paginator::defaultView('pagination.default'); Paginator::defaultSimpleView('pagination.simple'); + + $this->addAboutCommandInfo(); } protected function registerBlueprintMacros(): void @@ -146,4 +150,23 @@ public function getAppVersion(): string return trim(file_get_contents($version)); } + + protected function addAboutCommandInfo(): void + { + $isEnabled = fn (bool $state) => $state + ? 'ENABLED' + : 'DISABLED'; + + AboutCommand::add('Website Factory', fn () => [ + 'Edition' => config('website-factory.edition'), + 'Version' => config('app.version'), + ]); + + AboutCommand::add('Website Factory: Features', fn () => [ + 'Commit Global Banner' => $isEnabled(! config('website-factory.hide_banner')), + 'Decisions' => $isEnabled(Features::hasDecisions()), + 'Donations' => $isEnabled(Features::hasDonations()), + 'Theme' => $isEnabled(Features::hasTheme()), + ]); + } }