fixes on tags with slug

This commit is contained in:
Ludovic CANDELLIER
2022-01-22 22:05:18 +01:00
parent 8c9fc66b89
commit ab8f68e4bc
3 changed files with 62 additions and 2 deletions

View File

@@ -56,7 +56,7 @@ class Articles
$data['image_big'] = Articles::getImage($article->image);
$data['inherited'] = self::getInherited($id);
$data['categories'] = self::getCategoriesNameByArticle($article);
$data['tags'] = self::getTagsNameByArticle($article);
$data['tags'] = self::getTagsSlugByArticle($article);
$data['comments'] = Comments::getByModel($article);
return $data;
}
@@ -263,6 +263,11 @@ class Articles
return $article->tags->pluck('name', 'id')->toArray();
}
public static function getTagsSlugByArticle($article)
{
return $article->tags->pluck('slug', 'id')->toArray();
}
public static function getPricesByArticle($article)
{
return Prices::getByArticle($article->id);