@extends('frontend.layouts.master') @section('title', 'Baut Motor || ecommerce') @section('main-content') @if (count($banners) > 0) @endif
@php $category_lists = DB::table('categories') ->where('status', 'active') ->limit(3) ->get(); @endphp @if ($category_lists) @foreach ($category_lists as $cat) @if ($cat->is_parent == 1)
@php $photo = $cat->photo ? explode(',', $cat->photo)[0] : 'default-image.jpg'; $imagePath = $photo ? asset("images/categories/$photo") : asset('images/categories/default-image.jpg'); @endphp {{ $cat->title }}

{{ $cat->title }}

Discover Now
@endif @endforeach @endif

Trending Item

@if ($product_lists) @foreach ($product_lists as $key => $product) @endforeach @endif
{{-- @php $featured=DB::table('products')->where('is_featured',1)->where('status','active')->orderBy('id','DESC')->limit(1)->get(); @endphp --}} {{--
@if ($featured) @foreach ($featured as $data)
@php $photo = explode(',', $data->photo); @endphp {{ $photo[0] }}

{{$data->cat_info['title']}}

{{ $data->title }}
Up to {{ $data->discount }}%

Shop Now
@endforeach @endif
--}}

Latest Items

@php $product_lists = DB::table('products') ->where('status', 'active') ->orderBy('id', 'DESC') ->limit(6) ->get(); @endphp @foreach ($product_lists as $product)
@php $photo = explode(',', $product->photo); // dd($photo); @endphp {{ $photo[0] }}

{{ $product->title }}

Disc: {{ number_format($product->discount, 2) }}%

@endforeach

From Our Blog

@if ($posts) @foreach ($posts as $post)
{{ $post->photo }}

{{ $post->created_at->format('d M , Y. D') }}

{{ $post->title }} Continue Reading
@endforeach @endif
{{--

Gratis Pengiriman

Pembelian diatas Rp. 100 jt

Gratis Bonus

Pembelian diatas Rp. 10 jt

Keamanan Pembayaran

100% aman

Harga Murah

Paling murah

--}} {{-- @include('frontend.layouts.newsletter') --}} @if ($product_lists) @foreach ($product_lists as $key => $product) @endforeach @endif @endsection @push('styles') @endpush @push('scripts') @endpush