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 @@
+
+ Article Hero Image +
@@ -158,7 +167,7 @@ class="prose prose-lg text-gray-800 prose-lio" @endif @if ($article->author()->hasTwitterAccount()) - + @endif diff --git a/resources/views/components/articles/overview-summary.blade.php b/resources/views/components/articles/overview-summary.blade.php index b0cfa6a1a..e738ebe4f 100644 --- a/resources/views/components/articles/overview-summary.blade.php +++ b/resources/views/components/articles/overview-summary.blade.php @@ -6,12 +6,14 @@
- -
+ Article Hero Image -
diff --git a/resources/views/components/articles/summary.blade.php b/resources/views/components/articles/summary.blade.php index 1dfa30c9c..9ad87ff51 100644 --- a/resources/views/components/articles/summary.blade.php +++ b/resources/views/components/articles/summary.blade.php @@ -7,7 +7,13 @@
@if ($isFeatured) -
+ Article Hero Image
@endif diff --git a/resources/views/components/articles/user-summary.blade.php b/resources/views/components/articles/user-summary.blade.php index bc97c7a19..9c0cf7908 100644 --- a/resources/views/components/articles/user-summary.blade.php +++ b/resources/views/components/articles/user-summary.blade.php @@ -5,11 +5,13 @@