diff --git a/app/Console/Commands/Onetime/UpdateResourceDescriptions.php b/app/Console/Commands/Onetime/UpdateResourceDescriptions.php index 09c69a5ac..5d466886e 100644 --- a/app/Console/Commands/Onetime/UpdateResourceDescriptions.php +++ b/app/Console/Commands/Onetime/UpdateResourceDescriptions.php @@ -120,6 +120,18 @@ public function handle(): int 'not_found' => array_filter($results, fn($r) => $r['status'] === 'NOT FOUND'), ]); + $this->newLine(); + $duplicates = $data + ->groupBy(fn($row) => trim((string)($row['Name of the resource'] ?? $row[0] ?? ''))) + ->map(fn($group) => $group->count()) + ->filter(fn($count) => $count > 1); + + if ($duplicates->isNotEmpty()) { + $this->newLine(2); + $this->warn('Duplicate resource titles detected:'); + $this->table(['Resource Name', 'Count'], $duplicates->map(fn($count, $name) => [$name, $count])->values()); + } + if ($dryRun) { $this->warn('Dry run only — no data was modified.'); } diff --git a/resources/excel/Uploaded resources.xlsx b/resources/excel/Uploaded resources.xlsx index 3ba28861f..f6f672b43 100644 Binary files a/resources/excel/Uploaded resources.xlsx and b/resources/excel/Uploaded resources.xlsx differ