@extends ('includes.main-layout')

@section('styles')

@endsection

@section('header')
    @include('includes.header')
@endsection

@section('content')
    <div class="row mt-4">
    @include('includes.errors')
    @foreach($products as $product)
        <div class="col-4">
            <div class="card mb-2" style="width: 18rem;">
                <img class="card-img-top" height="200" src="{{URL::to('images/'.$product->file)}}" alt="Produit">
                <div class="card-body">
                    <h5 class="card-title">{{$product->name}}</h5>
                    <p class="card-text">{{$product->prix}} DH</p>
                    <a href="{{route('products.show',['id'=>$product->id])}}" class="btn btn-primary btn-block">Voir</a>
                </div>
            </div>
        </div>
    @endforeach
    </div>
@endsection

@section('footer')

@endsection

@section('scripts')

@endsection
