<?php $__env->startSection('content'); ?>
    <div class="card shadow mb-4">
        <div class="card-header py-3 d-flex">
            <h6 class="m-0 font-weight-bold text-success">
                Product Reviews
            </h6>
            <div class="ml-auto"></div>
        </div>

        <?php echo $__env->make('partials.backend.filter', ['model' => route('admin.reviews.index')], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

        <div class="table-responsive">
            <table class="table table-hover">
                <thead>
                <tr>
                    <th>Name</th>
                    <th>Title</th>
                    <th>Rating</th>
                    <th>Product</th>
                    <th>Status</th>
                    <th>Created at</th>
                    <th class="text-center" style="width: 30px;">Action</th>
                </tr>
                </thead>
                <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $reviews; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $review): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td>
                            <a href="<?php echo e(route('admin.reviews.show', $review->id)); ?>">
                                <?php echo e($review->customer_id ? $review->user->full_name : $review->name); ?>

                            </a><br>
                            <small><?php echo e($review->email); ?></small><br>
                        </td>
                        <td><?php echo e($review->title); ?></td>
                        <td><span class="badge badge-success"><?php echo e($review->rating); ?></span></td>
                        <td><?php echo e($review->product->name); ?></td>
                        <td><?php echo e($review->active); ?></td>
                        <td><?php echo e($review->created_at ? $review->created_at->format('Y-m-d') : ''); ?></td>
                        <td>
                            <div class="btn-group btn-group-sm">
                                <a href="<?php echo e(route('admin.reviews.edit', $review)); ?>" class="btn btn-primary">
                                    <i class="fa fa-edit"></i>
                                </a>
                                <a href="javascript:void(0);"
                                   onclick="if (confirm('Are you sure to delete this record?'))
                                       {document.getElementById('delete-review-<?php echo e($review->id); ?>').submit();} else {return false;}"
                                   class="btn btn-danger">
                                    <i class="fa fa-trash"></i>
                                </a>
                            </div>
                            <form action="<?php echo e(route('admin.reviews.destroy', $review)); ?>"
                                  method="POST"
                                  id="delete-review-<?php echo e($review->id); ?>" class="d-none">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                            </form>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td class="text-center" colspan="7">No reviews found.</td>
                    </tr>
                <?php endif; ?>
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="7">
                        <div class="float-right">
                            <?php echo $reviews->appends(request()->all())->links(); ?>

                        </div>
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
<?php $__env->stopSection(); ?>

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