Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tauseefsshah committed Sep 30, 2024
1 parent 77927a1 commit c4957ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Console/Commands/SyncArticleImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public function handle(): void
Article::published()->chunk(100, function ($articles) {
$articles->each(function ($article) {
if ($article->hasHeroImage()) {
$article->hero_image_url = $this->getUnsplashImageUrlFromStringId($article->hero_image);
$article->hero_image_url = $this->generateUnsplashImageUrlFromStringId($article->hero_image);
$article->save();
}
});
});
}

protected function getUnsplashImageUrlFromStringId(string $imageId): ?string
protected function generateUnsplashImageUrlFromStringId(string $imageId): ?string
{
$response = Http::retry(3, 100, null, false)->withToken($this->accessKey, 'Client-ID')
->get("https://api.unsplash.com/photos/{$imageId}");
Expand Down

0 comments on commit c4957ca

Please sign in to comment.