@if ($CategoryAttribute->count() > 0) @foreach ($CategoryAttribute as $key => $attributes) @endforeach @else @endif
S.No. {{ translate('Attribute Name') }} {{ translate('Type') }} {{ translate('Associated Category') }} {{ translate('Created On') }} {{ translate('Deleted On') }} {{ translate('Action') }}
{{ $key + 1 + ($CategoryAttribute->currentPage() - 1) * $CategoryAttribute->perPage() }} {{ $attributes->title ?? 'N/A' }} {{ $attributes->type ?? 'N/A' }} @php // Retrieve categories based on comma-separated IDs $categories = \App\Models\Category::whereIn( 'id', explode(',', $attributes->category_id), )->get(); @endphp

{{ $attributes->category_id ?? 'N/A' }}

    @foreach ($categories as $categoryIndex => $category) @php $categoryParts = explode('>', $category->name); @endphp
  • @foreach ($categoryParts as $index => $part) {!! $categoryIndex == count($categories) - 1 && $index == count($categoryParts) - 1 ? "$part" : $part !!} @if ($index < count($categoryParts) - 1) > @endif @endforeach
  • @if ($categoryIndex < count($categories) - 1) > @endif @endforeach
@if (!empty($attributes->related_category)) @php $previousSetId = null; $ulCount = 0; @endphp @foreach ($attributes->related_category as $related) @php $categoryHierarchy = []; $category = App\Models\Category::find($related['cat_id']); // Fetch the category by ID // Build category hierarchy only if the category exists while ($category) { array_unshift($categoryHierarchy, $category->name ?? 'N/A'); $category = $category->parent ? App\Models\Category::find($category->parent_id) : null; } @endphp @if (!empty($categoryHierarchy)) @if ($related['set_id'] !== $previousSetId) @php $ulCount++; // Increment the
    counter $previousSetId = $related['set_id']; @endphp @endif @endif @endforeach
    @if ($ulCount > 1) @endif
    @endif
{{ \Carbon\Carbon::parse($attributes->created_at)->format('Y-m-d h:i A') }} {{ \Carbon\Carbon::parse($attributes->deleted_at)->format('Y-m-d h:i A') }}
@if (!empty(request()->search))

No result found

@else

No data added yet

@endif
Total Soft Delete Specification(s): {{ $CategoryAttribute->total() }}
{{ $CategoryAttribute->appends(request()->input())->links() }}