

<?php $__env->startSection('backend_content'); ?>
    <div class="container-fluid">
        <div class="d-flex justify-content-between align-items-center mb-4">
            <div>
                <h4 class="fw-bold mb-1">Menu Items - <?php echo e($foodCart->name); ?></h4>
                <small class="text-muted">Add and manage food items individually for search and ordering.</small>
            </div>
            <div class="d-flex gap-2">
                <a href="<?php echo e(route('admin.food-carts.items.create', $foodCart)); ?>" class="btn btn-primary">
                    <i class="bx bx-plus"></i> Add Item
                </a>
                <a href="<?php echo e(route('admin.food-carts.index')); ?>" class="btn btn-light">
                    <i class="bx bx-arrow-back"></i> Back
                </a>
            </div>
        </div>

        <div class="card border-0 shadow-sm">
            <div class="table-responsive">
                <table class="table table-hover mb-0">
                    <thead class="table-light">
                        <tr>
                            <th>Item</th>
                            <th>Price</th>
                            <th>Status</th>
                            <th>Tags</th>
                            <th>Created By</th>
                            <th class="text-end">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                <td>
                                    <div class="d-flex align-items-center gap-2">
                                        <?php if($item->image): ?>
                                            <img src="<?php echo e(asset('storage/' . $item->image)); ?>" alt="<?php echo e($item->title); ?>"
                                                class="rounded" style="width:42px;height:42px;object-fit:cover;">
                                        <?php else: ?>
                                            <div class="bg-light border rounded d-flex align-items-center justify-content-center"
                                                style="width:42px;height:42px;"><i class="bx bx-bowl-hot"></i></div>
                                        <?php endif; ?>
                                        <div>
                                            <div class="fw-semibold"><?php echo e($item->title); ?></div>
                                            <small
                                                class="text-muted"><?php echo e(\Illuminate\Support\Str::limit($item->description, 55)); ?></small>
                                        </div>
                                    </div>
                                </td>
                                <td>$<?php echo e(number_format((float) $item->price, 2)); ?></td>
                                <td>
                                    <?php if($item->is_available): ?>
                                        <span class="badge bg-success">Available</span>
                                    <?php else: ?>
                                        <span class="badge bg-secondary">Unavailable</span>
                                    <?php endif; ?>
                                </td>
                                <td>
                                    <?php $tags = collect($item->search_tags ?? [])->take(3); ?>
                                    <?php $__empty_2 = true; $__currentLoopData = $tags; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tag): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_2 = false; ?>
                                        <span class="badge bg-light text-dark"><?php echo e($tag); ?></span>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_2): ?>
                                        <span class="text-muted">-</span>
                                    <?php endif; ?>
                                </td>
                                <td><?php echo e($item->creator?->name ?? 'N/A'); ?></td>
                                <td class="text-end">
                                    <div class="btn-group">
                                        <a href="<?php echo e(route('admin.food-carts.items.edit', [$foodCart, $item])); ?>"
                                            class="btn btn-sm btn-outline-warning">
                                            <i class="bx bx-edit"></i>
                                        </a>
                                        <form action="<?php echo e(route('admin.food-carts.items.destroy', [$foodCart, $item])); ?>"
                                            method="POST" onsubmit="return confirm('Delete this food item?');">
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('DELETE'); ?>
                                            <button class="btn btn-sm btn-outline-danger" type="submit">
                                                <i class="bx bx-trash"></i>
                                            </button>
                                        </form>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="6" class="text-center text-muted py-5">No food items found. Add your first
                                    item.</td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('backend.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\Abdur Rahman\Desktop\faa\resources\views/backend/food-menu-items/index.blade.php ENDPATH**/ ?>