Files

25 lines
598 B
PHP
Raw Permalink Normal View History

2026-08-09 12:43:21 +03:00
<?php
namespace App\Console\Commands;
use App\Models\Tool;
use Illuminate\Console\Command;
class MirrorToolLogos extends Command
{
protected $signature = 'tools:mirror-logos';
2026-08-11 00:06:19 +03:00
protected $description = 'Queue jobs to resolve and download tool logos (external, missing, or broken) and serve them from local storage';
2026-08-09 12:43:21 +03:00
public function handle(): int
{
2026-08-11 00:06:19 +03:00
$tools = Tool::query()->get()->reject->hasLocalLogo();
2026-08-09 12:43:21 +03:00
$tools->each->queueLogoMirrorIfNeeded();
$this->info("Queued {$tools->count()} tool logo(s) for mirroring.");
return self::SUCCESS;
}
}