Skip to content

Commit

Permalink
chore: add about info
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed May 18, 2023
1 parent eb2c4a3 commit 8b8fa53
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -73,6 +75,8 @@ public function boot()

Paginator::defaultView('pagination.default');
Paginator::defaultSimpleView('pagination.simple');

$this->addAboutCommandInfo();
}

protected function registerBlueprintMacros(): void
Expand Down Expand Up @@ -146,4 +150,23 @@ public function getAppVersion(): string

return trim(file_get_contents($version));
}

protected function addAboutCommandInfo(): void
{
$isEnabled = fn (bool $state) => $state
? '<fg=green;options=bold>ENABLED</>'
: '<fg=yellow;options=bold>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()),
]);
}
}

0 comments on commit 8b8fa53

Please sign in to comment.