Files
animethemes-server/app/Console/Commands/Models/SyncViewAggregatesCommand.php
T
2025-08-29 21:17:01 -03:00

35 lines
824 B
PHP

<?php
declare(strict_types=1);
namespace App\Console\Commands\Models;
use App\Actions\Models\Aggregate\SyncViewAggregatesAction;
use App\Console\Commands\BaseCommand;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Support\Facades\Validator as ValidatorFacade;
class SyncViewAggregatesCommand extends BaseCommand
{
protected $signature = 'view:sync-aggregates';
protected $description = 'Synchronizes views in the aggregates table';
public function handle(): int
{
$action = new SyncViewAggregatesAction();
$result = $action->handle();
$result->toLog();
$result->toConsole($this);
return $result->hasFailed() ? 1 : 0;
}
protected function validator(): Validator
{
return ValidatorFacade::make($this->options(), []);
}
}