

<?php $__env->startSection('content'); ?>
<div class="card p-4">
    <div class="d-flex justify-content-between align-items-center mb-3">
        <h4>All Products</h4>
        <a href="<?php echo e(route('products.create')); ?>" class="btn btn-primary">Add Product</a>
    </div>

    <?php if(session('success')): ?>
        <div class="alert alert-success"><?php echo e(session('success')); ?></div>
    <?php endif; ?>

    <table class="table table-bordered">
        <thead>
            <tr>
                <th>#</th>
                <th>Image</th>
                <th>Title</th>
                <th>Price</th>
                <th>Brand</th>
                <th>Condition</th>
                <th>Stock</th>
                <th>Category</th>
                <th>Shop Category</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            <?php $__empty_1 = true; $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <tr>
                <td><?php echo e($loop->iteration); ?></td>
                <td>
                    <?php if($product->image): ?>
                        <img src="<?php echo e(asset($product->image)); ?>" width="50" height="50" alt="">
                    <?php else: ?>
                        <span>No Image</span>
                    <?php endif; ?>
                </td>
                <td><?php echo e($product->title); ?></td>
                <td>Rs. <?php echo e($product->price); ?></td>
                <td><?php echo e($product->brand); ?></td>
                <td><?php echo e($product->condition); ?></td>
                <td><?php echo e($product->stock); ?></td>
                <td><?php echo e($product->category); ?></td>
                <td><?php echo e($product->shop_category); ?></td>
                <td>
                    <a href="<?php echo e(route('products.edit', $product->id)); ?>" class="btn btn-sm btn-warning">Edit</a>
                    <form action="<?php echo e(route('products.destroy', $product->id)); ?>" method="POST" class="d-inline"
                        onsubmit="return confirm('Delete this product?')">
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('DELETE'); ?>
                        <button class="btn btn-sm btn-danger">Delete</button>
                    </form>
                </td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <tr>
                <td colspan="10" class="text-center">No products found.</td>
            </tr>
            <?php endif; ?>
        </tbody>
    </table>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.admin-dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home2/pataneye/public_html/resources/views/admin/pages/products/index.blade.php ENDPATH**/ ?>