<?php

namespace App\SiteReadiness\Checks;

use App\SiteReadiness\CheckResult;
use App\SiteReadiness\ReadinessCheck;
use App\SiteReadiness\Status;

class AppKeyCheck implements ReadinessCheck
{
    public function group(): string { return 'Environment'; }
    public function label(): string { return 'Application key set'; }
    public function hint(): string { return 'Run php artisan key:generate.'; }

    public function run(): CheckResult
    {
        if (!empty(config('app.key'))) {
            return new CheckResult(Status::OK, 'APP_KEY is set.');
        }
        return new CheckResult(Status::FAIL, 'APP_KEY is empty.');
    }
}
