From a063aaa1a18e696ddac2c668e4500163d8cb2271 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Fri, 24 Apr 2020 14:56:57 -0400 Subject: [PATCH] Get blog tags working again --- app/Models/Blog.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Models/Blog.php b/app/Models/Blog.php index 1ac42fa..975c7e0 100644 --- a/app/Models/Blog.php +++ b/app/Models/Blog.php @@ -4,6 +4,7 @@ namespace App\Models; use Parsedown; use App\User; +use App\Models\BlogTags; class Blog extends DashboardModel { @@ -41,8 +42,8 @@ class Blog extends DashboardModel // Replace the tags string with an array $tags = []; - foreach (explode(';', $blog_entry['tags']) as $tag) { - array_push($tags, $tag); + foreach (BlogTags::where('blog_id', $blog_entry->id)->orderBy('order')->get() as $tag) { + array_push($tags, $tag['name']); } $blog_entry['tags'] = $tags;