<?php

namespace FluxCms\Core\Commands;

use FluxCms\Core\Services\ComponentRegistry;
use Illuminate\Console\Command;

class ClearCacheCommand extends Command
{
    protected $signature = 'flux-cms:clear-cache';

    protected $description = 'Clear the Flux CMS component registry cache';

    public function handle(ComponentRegistry $registry): int
    {
        $this->info('Clearing Flux CMS component cache...');
        $registry->clearCache();
        $this->info('Flux CMS component cache cleared successfully!');

        return self::SUCCESS;
    }
}
