Files
omg-wtf-ai/app/Console/Commands/MirrorToolLogos.php
T

25 lines
599 B
PHP
Raw 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';
protected $description = 'Queue jobs to download externally-hosted tool logos and serve them from local storage';
public function handle(): int
{
$tools = Tool::query()->whereNotNull('logo_url')->get()->reject->hasLocalLogo();
$tools->each->queueLogoMirrorIfNeeded();
$this->info("Queued {$tools->count()} tool logo(s) for mirroring.");
return self::SUCCESS;
}
}