<?php $__env->startSection('content'); ?>
    <div class="page-header">
        <div class="row">
            <div class="col-sm-12">
                <h3 class="page-title">Edit Category</h3>
                <ul class="breadcrumb">
                    <li class="breadcrumb-item"><a href="<?php echo e(route('categories.index')); ?>">Categories</a></li>
                    <li class="breadcrumb-item active">Edit Category</li>
                </ul>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-12">
            <div class="card">
                <div class="card-body">
                    <form action="<?php echo e(route('categories.update', $category->id)); ?>" method="POST" class="needs-validation"
                        novalidate>
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('PUT'); ?>
                        <div class="form-row row">
                            <?php if (\Illuminate\Support\Facades\Blade::check('role', 'Superadmin')): ?>
                            <div class="mb-3 col-md-6">
                                <label for="company_id">Company</label>
                                <select class="js-example-basic-single select2" name="company" required>
                                    <option value="">Select Company</option>
                                    <?php $__currentLoopData = $companies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $company): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($company->id); ?>"
                                            <?php echo e(old('company', $category->company_id) == $company->id ? 'selected' : ''); ?>><?php echo e($company->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <div class="invalid-feedback">Please select a company.</div>
                            </div>
                            <?php else: ?>
                                <input type="hidden" name="company" value="<?php echo e($category->company_id); ?>">
                            <?php endif; ?>
                            <div class="mb-3 col-md-6">
                                <label for="name">Name</label>
                                <input type="text" class="form-control" name="name" id="name"
                                    placeholder="Name" value="<?php echo e(old('name', $category->name)); ?>" required>
                            </div>
                            <div class="mb-3 col-md-6">
                                <label for="address">Prefix</label>
                                <input type="text" class="form-control" name="prefix" placeholder="Prefix"
                                    value="<?php echo e(old('prefix', $category->prefix)); ?>" required>
                            </div>
                            <div class="mb-3 col-md-6">
                                <label for="phone">Description</label>
                                <textarea name="description" id="description" class="form-control" placeholder="Description..."><?php echo e(old('description', $category->description)); ?></textarea>
                            </div>
                        </div>
                        <button class="btn btn-primary" type="submit">Update</button>
                        <a class="btn btn-secondary" href="<?php echo e(route('categories.index')); ?>">Cancel</a>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/aligkrwp/public_html/resources/views/admin/categories/edit.blade.php ENDPATH**/ ?>