
<?php $__env->startSection('content'); ?>
    <div class="card">
        <div class="card-header">
            <h5>Add Service</h5>
        </div>
        <div class="card-body">
            <form action="<?php echo e(isset($service) ? route('service.update', $service->id) : route('service.store')); ?>"
                method="POST" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <?php if(isset($service)): ?>
                    <?php echo method_field('PUT'); ?>
                <?php endif; ?>

                <div class="mb-3">
                    <label>Title</label>
                    <input type="text" name="title" class="form-control" value="<?php echo e(old('title', $service->title ?? '')); ?>"
                        required>
                </div>

                <div class="mb-3">
                    <label>Subtitle</label>
                    <input type="text" name="subtitle" class="form-control"
                        value="<?php echo e(old('subtitle', $service->subtitle ?? '')); ?>">
                </div>

                <div class="mb-3">
                    <label>Short Description</label>
                    <textarea name="short_description" class="form-control" rows="2"><?php echo e(old('short_description', $service->short_description ?? '')); ?></textarea>
                </div>

                <div class="mb-3">
                    <label>Description</label>
                    <textarea name="description" class="form-control" rows="4"><?php echo e(old('description', $service->description ?? '')); ?></textarea>
                </div>

                <div class="mb-3">
                    <label>Category</label>
                    <select name="category_id" class="form-control" required>
                        <option value="">Select Category</option>
                        <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($category->id); ?>"
                                <?php echo e(old('category_id', $service->category_id ?? '') == $category->id ? 'selected' : ''); ?>>
                                <?php echo e($category->name); ?>

                            </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>

                <div class="mb-3">
                    <label>Image</label>
                    <input type="file" name="image" accept="image/*" class="form-control">
                    <?php if(isset($service) && $service->image): ?>
                        <div class="mt-2">
                            <img src="<?php echo e(asset('storage/' . $service->image)); ?>" alt="Service Image" width="120">
                        </div>
                    <?php endif; ?>
                </div>

                <button class="btn btn-success mt-3"><?php echo e(isset($service) ? 'Update' : 'Save'); ?></button>
                <a href="<?php echo e(route('service.index')); ?>" class="btn btn-secondary mt-3">Cancel</a>
            </form>

        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.masterAdmin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TGP-hospital-site\resources\views/admin/service/create.blade.php ENDPATH**/ ?>