

<?php $__env->startSection('title', $title); ?>
<?php $__env->startSection('ad_page_title', 'Maid Links'); ?>
<?php $__env->startSection('ad_page_subtitle', 'Manage maid link pages'); ?>

<?php $__env->startSection('ad_content'); ?>
<div class="container-fluid py-4">
    <div class="d-flex flex-column flex-md-row justify-content-between align-items-md-center gap-3 mb-4">
        <div>
            <h1 class="h3 mb-1">Maid Links</h1>
            <p class="text-muted mb-0">Manage maid link pages</p>
        </div>

        <a href="<?php echo e(route('admin.maid-links.create')); ?>" class="btn btn-primary">
            <i class="fa-solid fa-plus me-2"></i>Create Maid Link
        </a>
    </div>

    <?php if(session('success')): ?>
        <div class="alert alert-success shadow-sm border-0">
            <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?>

    <div class="card shadow-sm border-0">
        <div class="card-body p-4">
            <form action="<?php echo e(route('admin.maid-links.index')); ?>" method="GET" class="row g-3 mb-4">
                <div class="col-lg-10">
                    <input
                        type="text"
                        name="search"
                        value="<?php echo e(request('search')); ?>"
                        class="form-control"
                        placeholder="Search by meta title, H1, title, slug, content or country"
                    >
                </div>

                <div class="col-lg-2 d-grid">
                    <button type="submit" class="btn btn-outline-primary">
                        <i class="fa-solid fa-magnifying-glass me-2"></i>Search
                    </button>
                </div>
            </form>

            <div class="table-responsive">
                <table class="table table-hover align-middle mb-0">
                    <thead>
                        <tr>
                            <th style="width: 70px;">#</th>
                            <th style="width: 110px;">Image</th>
                            <th>Meta Title / H1</th>
                            <th>Country</th>
                            <th>Slug</th>
                            <th>Created At</th>
                            <th class="text-end" style="width: 220px;">Actions</th>
                        </tr>
                    </thead>

                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $maidLinks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $maidLink): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                <td><?php echo e($maidLink->id); ?></td>

                                <td>
                                    <?php if($maidLink->image): ?>
                                        <img
                                            src="<?php echo e(asset('storage/' . $maidLink->image)); ?>"
                                            alt="<?php echo e($maidLink->title ?: $maidLink->h1); ?>"
                                            width="80"
                                            height="60"
                                            class="rounded border"
                                            style="object-fit: cover;"
                                        >
                                    <?php else: ?>
                                        <div class="d-flex align-items-center justify-content-center rounded border bg-light text-muted" style="width: 80px; height: 60px;">
                                            <i class="fa-regular fa-image"></i>
                                        </div>
                                    <?php endif; ?>
                                </td>

                                <td>
                                    <div class="fw-semibold"><?php echo e($maidLink->meta_title ?: '-'); ?></div>
                                    <div class="small text-muted mt-1"><?php echo e($maidLink->h1); ?></div>
                                    <?php if($maidLink->title): ?>
                                        <div class="small text-muted"><?php echo e($maidLink->title); ?></div>
                                    <?php endif; ?>
                                </td>

                                <td>
                                    <span class="badge text-bg-light border"><?php echo e($maidLink->nationality_name); ?></span>
                                </td>

                                <td>
                                    <code><?php echo e($maidLink->slug); ?></code>
                                </td>

                                <td>
                                    <?php echo e($maidLink->created_at?->format('Y-m-d H:i') ?? '-'); ?>

                                </td>

                                <td class="text-end">
                                    <div class="d-inline-flex gap-2 flex-wrap justify-content-end">
                                        <a href="<?php echo e(route('admin.maid-links.show', $maidLink)); ?>" class="btn btn-sm btn-info text-white">
                                            <i class="fa-solid fa-eye me-1"></i>View
                                        </a>

                                        <a href="<?php echo e(route('admin.maid-links.edit', $maidLink)); ?>" class="btn btn-sm btn-warning">
                                            <i class="fa-solid fa-pen-to-square me-1"></i>Edit
                                        </a>

                                        <form action="<?php echo e(route('admin.maid-links.destroy', $maidLink)); ?>" method="POST">
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('DELETE'); ?>

                                            <button
                                                type="submit"
                                                class="btn btn-sm btn-danger"
                                                onclick="return confirm('Delete this maid link?')"
                                            >
                                                <i class="fa-solid fa-trash me-1"></i>Delete
                                            </button>
                                        </form>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="7" class="text-center py-5 text-muted">
                                    No maid links found.
                                </td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>

            <?php if($maidLinks->hasPages()): ?>
                <div class="mt-4">
                    <?php echo e($maidLinks->links()); ?>

                </div>
            <?php endif; ?>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.ad_master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/onesourceerp/public_html/project/resources/views/admin/maid-links/index.blade.php ENDPATH**/ ?>