Fix tags with group name
This commit is contained in:
@@ -26,7 +26,7 @@ class TagGroups
|
|||||||
foreach ($items as $group) {
|
foreach ($items as $group) {
|
||||||
$group_tags = [];
|
$group_tags = [];
|
||||||
foreach ($group->tags as $tag) {
|
foreach ($group->tags as $tag) {
|
||||||
$group_tags[$tag->id] = $tag->name;
|
$group_tags[$tag->id] = $group->name . ' - ' . $tag->name;
|
||||||
}
|
}
|
||||||
$tags[] = [
|
$tags[] = [
|
||||||
'label' => $group->name,
|
'label' => $group->name,
|
||||||
|
|||||||
@@ -15,6 +15,15 @@ class Tags
|
|||||||
return Tag::get()->pluck('name', 'id')->toArray();
|
return Tag::get()->pluck('name', 'id')->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getOptionsFullName()
|
||||||
|
{
|
||||||
|
$tags = Tag::with('group')->get();
|
||||||
|
foreach ($tags as $tag) {
|
||||||
|
$data[$tag->id] = $tag->group->name . '-' . $tag->name;
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getAll()
|
public static function getAll()
|
||||||
{
|
{
|
||||||
return Tag::orderBy('order', 'asc')->get();
|
return Tag::orderBy('order', 'asc')->get();
|
||||||
|
|||||||
Reference in New Issue
Block a user