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

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

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

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

                <button type="submit" class="btn btn-success mt-3">
                    <?php echo e(isset($department) ? 'Update' : 'Save'); ?>

                </button>
                <a href="<?php echo e(route('department.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/department/edit.blade.php ENDPATH**/ ?>