Associated Tags
@if($assigned_tags_by_category && $assigned_tags_by_category->isNotEmpty()) @foreach($assigned_tags_by_category as $categoryName => $tags)
{{ $categoryName ?: 'Uncategorized' }}
@php $parentTags = $tags->filter(function($tag) { return !$tag->isSubTag(); }); $subTags = $tags->filter(function($tag) { return $tag->isSubTag(); }); @endphp
@foreach($parentTags as $parentTag) @php $children = $subTags->filter(function($tag) use ($parentTag) { return $tag->parent_id == $parentTag->id; }); $hasChildren = $children->count() > 0; @endphp @if(!$hasChildren)
@if($parentTag->description)
Tag Description
{{ $parentTag->description }}
@endif
@endif @endforeach
@foreach($parentTags as $parentTag) @php $children = $subTags->filter(function($tag) use ($parentTag) { return $tag->parent_id == $parentTag->id; }); $hasChildren = $children->count() > 0; @endphp @if($hasChildren)
@if($parentTag->description)
Tag Description
{{ $parentTag->description }}
@endif
@foreach($children as $childTag)
@if($childTag->description)
Tag Description
{{ $childTag->description }}
@endif
@endforeach
@endif @endforeach @php $standaloneSubTags = $subTags->filter(function($tag) use ($parentTags) { return !$parentTags->contains('id', $tag->parent_id); }); @endphp @if($standaloneSubTags->count() > 0)
@foreach($standaloneSubTags as $childTag)
@if($childTag->description)
Tag Description
{{ $childTag->description }}
@endif
@endforeach
@endif
@endforeach @elseif($assigned_tags_tree)
@foreach($assigned_tags_tree as $parentId => $treeItem) @php $parentTag = $treeItem['tag']; $children = $treeItem['children']; @endphp
@if(count($children) > 0)
@foreach($children as $childTag) @endforeach
@endif
@endforeach
@elseif($assigned_tags_by_category->isNotEmpty()) @foreach($assigned_tags_by_category as $categoryName => $tags)
{{ $categoryName ?: 'Uncategorized' }}
@foreach($tags as $case_tag) @endforeach
@endforeach @else
@foreach ($case_default_tags as $tag_id) @php $case_tag = \App\Models\case_tags::with('category')->find($tag_id) @endphp @if (isset($case_tag)) @endif @endforeach
@endif

Available Tags
@if($available_tags_by_category && $available_tags_by_category->isNotEmpty()) @foreach($available_tags_by_category as $categoryName => $tags)
{{ $categoryName ?: 'Uncategorized' }}
@php $parentTags = $tags->filter(function($tag) { return !$tag->isSubTag(); }); $subTags = $tags->filter(function($tag) { return $tag->isSubTag(); }); @endphp
@foreach($parentTags as $parentTag) @php $children = $subTags->filter(function($tag) use ($parentTag) { return $tag->parent_id == $parentTag->id; }); $hasChildren = $children->count() > 0; $canUseTag = $this->userCanUseTag($parentTag->id); @endphp @if(!$hasChildren)
@if($parentTag->description)
Tag Description
{{ $parentTag->description }}
@endif
@endif @endforeach
@foreach($parentTags as $parentTag) @php $children = $subTags->filter(function($tag) use ($parentTag) { return $tag->parent_id == $parentTag->id; }); $hasChildren = $children->count() > 0; $canUseParent = $this->userCanUseTag($parentTag->id); @endphp @if($hasChildren)
@if($parentTag->description)
Tag Description
{{ $parentTag->description }}
@endif
@foreach($children as $childTag) @php $canUseChild = $this->userCanUseTag($childTag->id); @endphp
@if($childTag->description)
Tag Description
{{ $childTag->description }}
@endif
@endforeach
@endif @endforeach @php $standaloneSubTags = $subTags->filter(function($tag) use ($parentTags) { return !$parentTags->contains('id', $tag->parent_id); }); @endphp @if($standaloneSubTags->count() > 0)
@foreach($standaloneSubTags as $childTag) @php $canUseChild = $this->userCanUseTag($childTag->id); @endphp
@if($childTag->description)
Tag Description
{{ $childTag->description }}
@endif
@endforeach
@endif
@endforeach @else

All tags are currently assigned to this form.

@endif
@if($isVisible) @endif @if($msg) @endif @if($showDeleteModal) @endif