

<?php $__env->startSection('content'); ?>
<div class="container">
    <div class="container-header">
        <h1><?php echo e($title); ?></h1>
        <a href="<?php echo e(route('backend.products.create')); ?>" class="btn btn-primary">Add product</a>
    </div>

    <div class="card table-card">
        <div class="table-header">
            <form method="get" action="<?php echo e(route('backend.products.index')); ?>" class="table-search-form">
                <div class="table-search-form__group">
                    <div class="table-search table-search--narrow">
                        <input type="text" name="search" class="search-input" placeholder="Search products..." value="<?php echo e($search ?? ''); ?>">
                        <i class="las la-search"></i>
                    </div>
                    <button type="submit" class="btn btn-secondary search-btn">Search</button>
                    <?php if(request()->filled('search')): ?>
                        <a href="<?php echo e(route('backend.products.index')); ?>" class="btn btn-outline">Clear</a>
                    <?php endif; ?>
                </div>
            </form>
        </div>
        <div class="table-responsive">
            <table class="table">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>Name</th>
                        <th>Category</th>
                        <th>Price</th>
                        <th>In stock</th>
                        <th>Status</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td><?php echo e($products->firstItem() + $loop->index); ?></td>
                        <td>
                            <?php if($p->image): ?>
                                <img src="<?php echo e(asset($p->image)); ?>" alt="" style="max-height:28px; margin-right:6px;" class="img-thumbnail">
                            <?php endif; ?>
                            <?php echo e($p->name); ?>

                        </td>
                        <td><?php echo e($p->productCategory->name ?? '-'); ?></td>
                        <td><?php echo e(number_format($p->price, 2)); ?></td>
                        <td><?php echo e($p->in_stock); ?></td>
                        <td><?php echo e($p->status ? 'On' : 'Off'); ?></td>
                        <td>
                            <div class="table-actions">
                                <a href="<?php echo e(route('backend.products.accounts', $p->id)); ?>" class="table-btn" title="Accounts"><i class="las la-list"></i></a>
                                <a href="<?php echo e(route('backend.products.edit', $p->id)); ?>" class="table-btn" title="Edit"><i class="las la-pen"></i></a>
                                <form action="<?php echo e(route('backend.products.destroy', $p->id)); ?>" method="post" class="d-inline" onsubmit="return confirm('Delete this product?');">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="table-btn" title="Delete"><i class="las la-trash"></i></button>
                                </form>
                            </div>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="7" class="text-center">No products yet.</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        <div class="pagination-wrapper">
            <?php echo e($products->links('vendor.pagination.default')); ?>

        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('backend.layout.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\HP\Desktop\social\product\core\resources\views/backend/products/products/index.blade.php ENDPATH**/ ?>