This commit is contained in:
Kekskurse 2021-02-08 11:03:14 +01:00
parent a40a9a523e
commit 6230f7e836
1 changed files with 8 additions and 3 deletions

View File

@ -32,10 +32,15 @@ class Gallery extends JsonResource
]];
$data["description"] = $this->description;
$t = json_decode($this->tags);
foreach ($t as $i => $g) {
$t[$i] = trim($g);
if(is_array($t)) {
foreach ($t as $i => $g) {
$t[$i] = trim($g);
}
$data["tags"] = $t;
} else {
$data["tags"] = null;
}
$data["tags"] = $t;
return $data;
}
}