the end goal is to concatate tag_names into a comma separated list
this returns an error of implode(): Invalid arguments passed:
$tags = ResourceTag::where('resource_id', $resource->id)->pluck('tag_name');
$tags = implode(", ", $tags);
but this works ok (going thru each result and adding it to an array manually):
$tags = ResourceTag::where('resource_id', $resource->id)->pluck('tag_name');
foreach($tags as $t) {
$tagString[] = $t ;
}
$tags = implode(", ", $tagString); // turn array into string
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community