

<?php $__env->startSection('content'); ?>
<div class="container mt-4">
    <h2 class="mb-4 text-center">Our Products</h2>
    <div class="row">

        <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="col-sm-4">
            <div class="card h-100 shadow-sm">
                <?php if($product->image): ?>
                <img src="<?php echo e(asset('storage/' .$product->image)); ?>" class="card-img-top">
                <?php endif; ?>
                <img src="https://vie.placeholder.com/300*200" class="card-img-top">
                <div class="card-body">
                    <h5 class="card-title"><?php echo e($product->name); ?></h5>
                    <p class="card-text text-muted"><?php echo e(Str::limit($product->
                description,60)); ?></p>
                    <p class="card-text fw-bold">$<?php echo e(number_format($product->
                price,2)); ?></p>
                </div>

                <div class="card-footer bg-white border-top-0">
                    <a href="<?php echo e(route('product.show',$product->id)); ?>"
                        class="btn btn-sm btn-dark w-100">View Details</a>

                    <br>
                    <form method="POST" action="<?php echo e(route('cart.add', $product->id)); ?>">
                        <?php echo csrf_field(); ?>
                        <button type="submit" class="btn btn-primary mt-3">Add  to cart</button>
                    </form>


                </div>
            </div>
        </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\khruk\Desktop\ecommerce\megastore\resources\views/product/index.blade.php ENDPATH**/ ?>