diff --git a/app/Models/Article.php b/app/Models/Article.php index 770aa7973..c3543c7ef 100644 --- a/app/Models/Article.php +++ b/app/Models/Article.php @@ -101,11 +101,6 @@ public function excerpt(int $limit = 100): string return Str::limit(strip_tags(md_to_html($this->body())), $limit); } - public function hasHeroImage(): bool - { - return $this->hero_image_url !== null; - } - public function hasHeroImageAuthor(): bool { return $this->hero_image_author_name !== null && @@ -114,11 +109,7 @@ public function hasHeroImageAuthor(): bool public function heroImage($width = 400, $height = 300): string { - if ($this->hasHeroImage()) { - return "{$this->hero_image_url}&fit=clip&w={$width}&h={$height}&utm_source=Laravel.io&utm_medium=referral"; - } - - return asset('images/default-background.svg'); + return "{$this->hero_image_url}&fit=clip&w={$width}&h={$height}&utm_source=Laravel.io&utm_medium=referral"; } public function originalUrl(): ?string diff --git a/resources/views/articles/show.blade.php b/resources/views/articles/show.blade.php index b6f5b14c7..87e631c9b 100644 --- a/resources/views/articles/show.blade.php +++ b/resources/views/articles/show.blade.php @@ -21,9 +21,18 @@