Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/Console/Commands/Onetime/UpdateResourceDescriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
Expand Down
Binary file modified resources/excel/Uploaded resources.xlsx
Binary file not shown.
Loading