<?php $__env->startSection('content'); ?>
<h1>Loan Products</h1>
<a href="<?php echo e(route('admin.loan-products.create')); ?>">+ Add New</a>
<table border="1" cellpadding="5">
    <thead>
        <tr>
            <th>Category</th>
            <th>Amount</th>
            <th>Interest % (Per Month)</th>
            <th>Tenures</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
        <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>


        <tr>
            <td><?php echo e($product->category->name ?? '-'); ?></td>
            <td><?php echo e($product->amount); ?></td>
            <td><?php echo e($product->interest_percent); ?></td>
            <td>
                <?php $__currentLoopData = $product->tenure_ids; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tid): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php echo e($tenures->firstWhere('id', $tid)->days ?? '?'); ?> days
                    <?php if(!$loop->last): ?>, <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </td>
            <td>
                <a href="<?php echo e(route('admin.loan-products.edit', $product->id)); ?>">Edit</a> |
                <form method="POST" action="<?php echo e(route('admin.loan-products.destroy', $product->id)); ?>" style="display:inline">
                    <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                    <button onclick="return confirm('Delete this product?')" type="submit">Delete</button>
                </form>
            </td>
        </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </tbody>
</table>
<?php $__env->stopSection(); ?>

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