diff --git a/app/Item.php b/app/Item.php index 39f297a5..76a8be7c 100644 --- a/app/Item.php +++ b/app/Item.php @@ -153,6 +153,23 @@ class Item extends Model return $tagdetails; } + /** + * @return string + */ + public function getTagClass(): string + { + $tags = $this->tags(); + $slugs = []; + + foreach ($tags as $tag) { + if ($tag->url) { + $slugs[] = 'tag-'.$tag->url; + } + } + + return implode(' ', $slugs); + } + /** * @return BelongsToMany */ diff --git a/resources/views/item.blade.php b/resources/views/item.blade.php index 9686d17f..df4c7285 100644 --- a/resources/views/item.blade.php +++ b/resources/views/item.blade.php @@ -1,4 +1,4 @@ -
+
@if($app->icon)