info('MakerWorld Collecties Synchronisatie gestart...'); $query = MakerWorldCollection::query(); if ($specificId = $this->option('collection')) { $query->where(function ($q) use ($specificId) { $q->where('id', $specificId) ->orWhere('makerworld_collection_id', $specificId); }); } elseif (! $this->option('all')) { $query->where('is_active_sync', true); } $collections = $query->get(); if ($collections->isEmpty()) { $this->comment('Geen actieve MakerWorld collecties gevonden om te synchroniseren.'); return self::SUCCESS; } $this->line("Aantal collecties te synchroniseren: {$collections->count()}"); $totalImported = 0; $totalUpdated = 0; foreach ($collections as $collection) { $this->info("Synchroniseren van '{$collection->name}' (#{$collection->makerworld_collection_id})..."); $result = $makerWorld->syncCollection($collection); if ($result['error']) { $this->error("Fout bij '{$collection->name}': {$result['error']}"); } else { $this->line(" ✓ {$result['imported']} nieuwe modellen binnengehaald als concept."); $this->line(" ✓ {$result['updated']} bestaande modellen bijgewerkt."); $totalImported += $result['imported']; $totalUpdated += $result['updated']; } } $this->info("Klaar! Totaal {$totalImported} nieuwe modellen binnengehaald en {$totalUpdated} bijgewerkt."); return self::SUCCESS; } }