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

<?php $__env->startSection('content'); ?>
<div class="page-content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-header">
                        <h4 class="card-title">Add New Category</h4>
                    </div>
                    <div class="card-body">
<form method="POST" action="<?php echo e(route('categories.store')); ?>" enctype="multipart/form-data">
<?php echo csrf_field(); ?>                            
                            <div class="mb-3">
                                <label for="name" class="form-label">Category Name</label>
                                <input type="text" class="form-control" id="name" name="name" required>
                            </div>
                            <div class="mb-3">
                                <label for="description" class="form-label">Description</label>
                                <textarea class="form-control" id="description" name="description" rows="3"></textarea>
                            </div>
                            <div class="mb-3">
                                <label for="icon" class="form-label">Icon Image</label>
                                <input type="file" class="form-control" id="icon" name="icon" accept="image/*">
                                <!-- Simple preview below the input -->
                                <img id="icon-preview" src="#" alt="Your icon will appear here" 
                                     style="display: none; max-width: 100px; margin-top: 10px;">
                            </div>
                            
                            <button type="submit" class="btn btn-primary">Add Category</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
document.getElementById('icon').addEventListener('change', function(e) {
    const preview = document.getElementById('icon-preview');
    if (this.files && this.files[0]) {
        const reader = new FileReader();
        reader.onload = function(e) {
            preview.src = e.target.result;
            preview.style.display = 'block';
        }
        reader.readAsDataURL(this.files[0]);
    } else {
        preview.style.display = 'none';
    }
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u180427332/domains/lime-stinkbug-754807.hostingersite.com/public_html/mulikat/resources/views/dashboard/categories/create.blade.php ENDPATH**/ ?>