argument('vendor'); if ($vendorSlug) { $vendors = Vendor::where('slug', $vendorSlug)->get(); if ($vendors->isEmpty()) { $this->error("Vendor not found: {$vendorSlug}"); return self::FAILURE; } } else { $vendors = Vendor::active()->get(); } if ($vendors->isEmpty()) { $this->warn('No active vendors found.'); return self::SUCCESS; } $this->info('Checking vendors for updates...'); $this->newLine(); $table = []; foreach ($vendors as $vendor) { $localExists = $storageService->existsLocally($vendor, $vendor->current_version ?? 'current'); $hasCurrentVersion = ! empty($vendor->current_version); $hasPreviousVersion = ! empty($vendor->previous_version); $status = match (true) { ! $hasCurrentVersion => 'No version tracked', $localExists && $hasPreviousVersion => 'Ready to analyze', $localExists => 'Current only', default => 'Files missing', }; $table[] = [ $vendor->slug, $vendor->name, $vendor->getSourceTypeLabel(), $vendor->current_version ?? '-', $vendor->previous_version ?? '-', $vendor->getPendingTodosCount(), $status, ]; $vendor->update(['last_checked_at' => now()]); } $this->table( ['Slug', 'Name', 'Type', 'Current', 'Previous', 'Pending', 'Status'], $table ); if ($this->option('assets')) { $this->newLine(); $this->info('Checking package assets...'); $results = $assetService->checkAllForUpdates(); $assetTable = []; foreach ($results as $slug => $result) { $statusIcon = match ($result['status']) { 'success' => $result['has_update'] ?? false ? 'Update available' : 'Up to date', 'rate_limited' => 'Rate limited', 'skipped' => 'Skipped', default => 'Error', }; $assetTable[] = [ $slug, $result['latest'] ?? $result['installed'] ?? '-', $statusIcon, ]; } $this->table(['Asset', 'Version', 'Status'], $assetTable); } $this->newLine(); $this->info('Check complete.'); return self::SUCCESS; } }