@extends('layouts.app') @section('css_after') @endsection @section('js_before') @endsection @section('content')
@foreach(App\Category::orderBy('created_at', 'asc')->take(4)->get() as $rootCat)
{{$rootCat->title}}

{{$rootCat->title}}

Shop Now
@endforeach
@foreach($categories as $key => $category) @if(count($category->products))

{{$category->title}}

@php $offer = DB::table('category_offers')->where('category_id',$category->id)->latest()->first(); @endphp @if($offer) @endif @php $htp = 0; @endphp @foreach($category->products->where('show_home',1)->where('total_qty', '>', 0)->take('13') as $pKey => $product) @endforeach
@endif @endforeach
# # @endsection @section('js_after') @endsection