<?php $__env->startSection('title', 'Sliders'); ?>

<?php $__env->startSection('content_header'); ?>
    <h1>Sliders</h1>
    <a href="<?php echo e(route('admin.sliders.create')); ?>" class="btn btn-primary float-right">Add Slider</a>
<?php $__env->stopSection(); ?>

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

    <div class="card">
        <div class="card-header">
            <h3 class="card-title">All Sliders</h3>
        </div>

        <div class="card-body table-responsive p-0">
            <table class="table table-bordered table-hover text-nowrap">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>Image</th>
                        <th>Title</th>
                        <th>Subtitle</th>
                        <th>Button Text</th>
                        <th>Button Link</th>
                        <th>Position</th>
                        <th>Active</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $sliders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $slider): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($loop->iteration + ($sliders->currentPage()-1) * $sliders->perPage()); ?></td>
                            <td>
                                <?php if($slider->image): ?>
                                    <img src="<?php echo e(asset('storage/'.$slider->image)); ?>" alt="Slider Image" width="100">
                                <?php endif; ?>
                            </td>
                            <td><?php echo e($slider->title); ?></td>
                            <td><?php echo e($slider->subtitle); ?></td>
                            <td><?php echo e($slider->button_text); ?></td>
                            <td><?php echo e($slider->button_link); ?></td>
                            <td><?php echo e($slider->position ?? '-'); ?></td>
                            <td>
                                <?php if($slider->is_active): ?>
                                    <span class="badge bg-success">Yes</span>
                                <?php else: ?>
                                    <span class="badge bg-secondary">No</span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <a href="<?php echo e(route('admin.sliders.edit', $slider->id)); ?>" class="btn btn-sm btn-info">Edit</a>

                                <form action="<?php echo e(route('admin.sliders.destroy', $slider->id)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Are you sure?')">
                                    <?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="9" class="text-center">No sliders found.</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>

        <div class="card-footer clearfix">
            <?php echo e($sliders->links()); ?>

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

<?php echo $__env->make('adminlte::page', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /usr/local/var/www/memafarms/resources/views/admin/sliders/index.blade.php ENDPATH**/ ?>