Skip to content

Commit 13985d4

Browse files
committed
feat: remove hasHeroImage because it is now handled in front end
1 parent 2067a75 commit 13985d4

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

app/Models/Article.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ public function excerpt(int $limit = 100): string
101101
return Str::limit(strip_tags(md_to_html($this->body())), $limit);
102102
}
103103

104-
public function hasHeroImage(): bool
105-
{
106-
return $this->hero_image_url !== null;
107-
}
108-
109104
public function hasHeroImageAuthor(): bool
110105
{
111106
return $this->hero_image_author_name !== null &&
@@ -114,11 +109,7 @@ public function hasHeroImageAuthor(): bool
114109

115110
public function heroImage($width = 400, $height = 300): string
116111
{
117-
if ($this->hasHeroImage()) {
118-
return "{$this->hero_image_url}&fit=clip&w={$width}&h={$height}&utm_source=Laravel.io&utm_medium=referral";
119-
}
120-
121-
return asset('images/default-background.svg');
112+
return "{$this->hero_image_url}&fit=clip&w={$width}&h={$height}&utm_source=Laravel.io&utm_medium=referral";
122113
}
123114

124115
public function originalUrl(): ?string

0 commit comments

Comments
 (0)