@if(count($categories) > 0 || count($products) > 0) @if(count($categories) > 0)
Categories
@foreach($categories as $key => $category)
@if (isset($category->image)) @else @endif {{ $category->name }}
@endforeach @endif @if(count($products) > 0)
Verified Products
@foreach($products as $key => $product)
@if (isset($product->image)) @if (json_decode($product->image) == '') @else @if(count(json_decode($product->image)) > 1) @else @endif @endif @endif
{{ $product->name }}
{{ $product->category ? $product->category->name : '' }}
@endforeach @endif @elseif(strlen($search) <= 0)
Popular Categories
@foreach (\App\Models\Category::where('category_id',null)->take(6)->get() as $category)
@if (isset($category->image)) @else @endif {{ $category->name }}
@endforeach @endif