From 091a9a5bde449d6ce16bae964cee6507c58fd928 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 31 Oct 2021 10:04:35 +0100 Subject: [PATCH] Add icon for slider --- components/facebookpagefeed/default.htm | 2 +- models/Page.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/facebookpagefeed/default.htm b/components/facebookpagefeed/default.htm index 75c2a8f..ba181a2 100644 --- a/components/facebookpagefeed/default.htm +++ b/components/facebookpagefeed/default.htm @@ -23,7 +23,7 @@ {{post.intro}} …
- {{'facebook-square'|sprite('w-6 h-6 mr-3 fill-current text-primary-500')}} + {{post.page.icon|sprite('w-6 h-6 mr-3 fill-current text-primary-500')}} Beitrag anschauen
diff --git a/models/Page.php b/models/Page.php index 95202c0..b38f796 100644 --- a/models/Page.php +++ b/models/Page.php @@ -74,6 +74,11 @@ class Page extends Model return 'social/'.$this->slug.'/'; } + public function getIconAttribute(): string + { + return "{$this->type}-slider"; + } + public function beforeDelete() { $this->posts->each->delete();