<?php if (isset($component)) { $__componentOriginalc6e081c8432fe1dd6b4e43af4871c93447ee9b23 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\MasterLayout::class, []); ?>
<?php $component->withName('master-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <div class="card card-block card-stretch">
                    <div class="card-body p-0">
                        <div class="d-flex justify-content-between align-items-center p-3">
                            <h5 class="font-weight-bold"><?php echo e($pageTitle ?? __('message.list')); ?></h5>
                            <?php if($count != 3): ?>
                                <a href="<?php echo e(route('whydelivery.create')); ?>"class="float-right btn btn-sm btn-primary jqueryvalidationLoadRemoteModel"><?php echo e(__('message.whydelivery')); ?></a>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <?php echo e(Form::open(['method' => 'POST', 'route' => [ 'frontend.website.information.update', 'why_choose'],  'id' => 'whydelivery_form', 'enctype' => 'multipart/form-data'])); ?>

                        <div class="row">
                            <?php $__currentLoopData = $whydelivery; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if( in_array( $key, ['title'] )): ?>
                                    <div class="col-md-6 form-group">
                                        <?php echo e(Form::label($key, __('message.'.$key) . ' <span class="text-danger">*</span>', ['class'=>'form-control-label'], false )); ?>

                                        <?php echo e(Form::text($key, $value ?? null,[ 'placeholder' =>  __('message.'.$key), 'class' => 'form-control', 'required' => true ])); ?>

                                    </div>
                                <?php else: ?>
                                    <div class="col-md-12 form-group">
                                        <?php echo e(Form::label($key, __('message.'.$key) . ' <span class="text-danger">*</span>', ['class'=>'form-control-label'], false )); ?>

                                        <?php echo e(Form::textarea($key, $value ?? null, ['class' => 'form-control textarea', 'rows' => 3, 'placeholder' => __('message.'.$key), 'required' => true])); ?>

                                    </div>
                                <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                        <hr>
                        <div class="col-md-12 mt-1 mb-4">
                            <button class="btn btn-md btn-primary float-md-right" id="saveButton"><?php echo e(__('message.save')); ?></button>
                        </div>
                    <?php echo e(Form::close()); ?>

                    </div>
                    <?php if(count($data) > 0): ?>
                        <?php echo $__env->make('whydelivery.list', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    <?php endif; ?>
                    <br>
                </div>
            </div>
        </div>
    </div>
    <?php $__env->startSection('bottom_script'); ?>
    <script>
        $(document).ready(function() {
            $("#whydelivery_form").validate({
                rules: {
                    'value[]': {
                        required: true
                    }
                },
                messages: {
                    'value[]': {
                        required: "<?php echo e(__('message.please_enter_value')); ?>"
                    }
                },
                errorPlacement: function(error, element) {
                    error.addClass('text-danger');
                    error.insertAfter(element);
                },
                highlight: function(element, errorClass, validClass) {
                    $(element).addClass('is-invalid');
                    $(element).removeClass('is-valid');
                },
                unhighlight: function(element, errorClass, validClass) {
                    $(element).removeClass('is-invalid');
                    $(element).addClass('is-valid');
                }
            });
        });
    </script>
    <?php $__env->stopSection(); ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc6e081c8432fe1dd6b4e43af4871c93447ee9b23)): ?>
<?php $component = $__componentOriginalc6e081c8432fe1dd6b4e43af4871c93447ee9b23; ?>
<?php unset($__componentOriginalc6e081c8432fe1dd6b4e43af4871c93447ee9b23); ?>
<?php endif; ?>
<?php /**PATH /www/wwwroot/mxunzo.mimeld.com/resources/views/whydelivery/main.blade.php ENDPATH**/ ?>