| S.No. | {{translate('Attribute Name')}} | {{translate('Type')}} | {{translate('Associated Category')}} | {{translate('Created On')}} | {{translate('Restored On')}} | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ ($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' }}
@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
@if($ulCount > 1)
@endif
@endif
|
{{ \Carbon\Carbon::parse($attributes->created_at )->format('Y-m-d h:i A') }} | {{ \Carbon\Carbon::parse($attributes->is_restored )->format('Y-m-d h:i A') }} | ||||||||||||||||||||||||||||||||||||||||||||
|
@if (!empty(request()->search))
No result found@elseNo data added yet@endif |
|||||||||||||||||||||||||||||||||||||||||||||||||