Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Kovah/LinkAce

3159 stars
1 code files
View Kovah/LinkAce on GitHub

app/Console/Commands/UpdateLinkThumbnails.php

Open in GitHub
use App\Models\Link;
use Illuminate\Console\Command;
 
class UpdateLinkThumbnails extends Command
{
//
public function handle(): void
{
//
Link::where('status', Link::STATUS_OK)->latest()
->chunk(100, function ($links) use ($processedLinks, $totalCount) {
foreach ($links as $link) {
$this->updateThumbnailForLink($link);
sleep(1); // Rate limiting of outgoing traffic
}
 
$processedLinks += count($links);
$this->comment("Processed $processedLinks of $totalCount links.");
});
//
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.