From 8feb7b37fa606f9bc88cb10e38ae1c9467be4917 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Fri, 5 Mar 2021 14:50:54 -0800 Subject: [PATCH] Set tags keyword field with array --- app/Models/Food.php | 2 +- app/Models/Recipe.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Food.php b/app/Models/Food.php index e891746..fcd06d5 100644 --- a/app/Models/Food.php +++ b/app/Models/Food.php @@ -137,7 +137,7 @@ final class Food extends Model { return [ 'name' => $this->name, - 'tags' => $this->tags->pluck('name')->implode(','), + 'tags' => $this->tags->pluck('name')->toArray(), 'detail' => $this->detail, 'brand' => $this->brand, 'source' => $this->source, diff --git a/app/Models/Recipe.php b/app/Models/Recipe.php index 436df59..5d1862e 100644 --- a/app/Models/Recipe.php +++ b/app/Models/Recipe.php @@ -112,7 +112,7 @@ final class Recipe extends Model { return [ 'name' => $this->name, - 'tags' => $this->tags->pluck('name')->implode(','), + 'tags' => $this->tags->pluck('name')->toArray(), 'description' => $this->description, 'source' => $this->source, 'created_at' => $this->created_at,