

<?php $__env->startSection('title', 'Edit Menu Item'); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-4xl mx-auto">
    <div class="bg-white rounded-lg shadow p-6">
        <div class="flex justify-between items-center mb-6">
            <h2 class="text-2xl font-bold">Edit Menu Item</h2>
            <a href="<?php echo e(route('admin.categories.items', $item->category_id)); ?>" 
               class="px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300">
                Back to Menu Items
            </a>
        </div>
        
        <form action="<?php echo e(route('admin.items.update', $item->id)); ?>" method="POST">
            <?php echo csrf_field(); ?>
            <?php echo method_field('PUT'); ?>
            
            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Item Name *</label>
                    <input type="text" name="name" value="<?php echo e(old('name', $item->name)); ?>" required
                           class="w-full p-3 border rounded-lg">
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Category *</label>
                    <select name="category_id" required
                            class="w-full p-3 border rounded-lg">
                        <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($cat->id); ?>" 
                                <?php echo e($item->category_id == $cat->id ? 'selected' : ''); ?>>
                            <?php echo e($cat->name); ?>

                        </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Price *</label>
                    <input type="number" name="price" value="<?php echo e(old('price', $item->price)); ?>" 
                           required min="0" step="1000"
                           class="w-full p-3 border rounded-lg">
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Display Order</label>
                    <input type="number" name="order" value="<?php echo e(old('order', $item->order)); ?>"
                           class="w-full p-3 border rounded-lg">
                </div>
                
                <div class="md:col-span-2">
                    <label class="block text-sm font-medium text-gray-700 mb-2">Description</label>
                    <textarea name="description" rows="2"
                              class="w-full p-3 border rounded-lg"><?php echo e(old('description', $item->description)); ?></textarea>
                </div>
                <div class="flex items-center">
    <input type="checkbox" name="is_active" id="is_active" value="1"
           <?php echo e($item->is_active ? 'checked' : ''); ?>

           class="h-5 w-5 text-gold rounded">
    <label for="is_active" class="ml-2 text-gray-700">Available for order</label>
</div>
            </div>
            
            <div class="mt-6 flex justify-end space-x-4">
                <a href="<?php echo e(route('admin.categories.items', $item->category_id)); ?>"
                   class="px-6 py-3 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50">
                    Cancel
                </a>
                <button type="submit"
                        class="px-6 py-3 bg-gold text-black font-semibold rounded-lg hover:bg-dark-gold transition">
                    Update Menu Item
                </button>
            </div>
        </form>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/sutanrajahotel/public_html/fb/tesmenu/resources/views/admin/item-edit.blade.php ENDPATH**/ ?>