@extends("admin.template.layout") @section("header") @stop @section("content")
| Sort | Name | Type | Category | Products | Banners | Category Sections | Sliders | Status | Created Date | Action |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ $item->name }} | {{ ucfirst($item->type) }} | {{ optional(\App\Models\Categories::find($item->category_id))->name ?? '-' }} | @php $productIds = is_array($item->product_ids) ? $item->product_ids : json_decode($item->product_ids, true) ?? []; $productNames = !empty($productIds) ? \App\Models\ProductModel::whereIn('id', $productIds)->pluck('product_name')->toArray() : []; @endphp {{ implode(', ', $productNames) ?: '-' }} | @php $bannerIds = is_array($item->banner_ids) ? $item->banner_ids : json_decode($item->banner_ids, true) ?? []; $bannerNames = !empty($bannerIds) ? \App\Models\WebBannerModel::whereIn('id', $bannerIds)->pluck('name')->toArray() : []; @endphp {{ implode(', ', $bannerNames) ?: '-' }} | @php $categorySectionIds = is_array($item->category_section_ids) ? $item->category_section_ids : json_decode($item->category_section_ids, true) ?? []; $categorySectionNames = \App\Models\Categories::whereIn('id', $categorySectionIds)->pluck('name')->toArray(); @endphp {{ $categorySectionNames ? implode(', ', $categorySectionNames) : '-' }} | @php $sliderIds = is_array($item->slider_ids) ? $item->slider_ids : json_decode($item->slider_ids, true) ?? []; $sliderNames = \App\Models\BannerModel::whereIn('id', $sliderIds)->pluck('banner_title')->toArray(); @endphp {{ $sliderNames ? implode(', ', $sliderNames) : '-' }} | {{ $item->active ? 'Active' : 'Inactive' }} | {{ get_date_in_timezone($item->created_at, config('global.datetime_format')) }} |