<?php $id = $id ?? null; ?>
<?php if(isset($id)): ?>
    <?php echo e(Form::model($data, ['route' => ['whydelivery.update', $id], 'method' => 'patch','enctype' => 'multipart/form-data'])); ?>

<?php else: ?>
    <?php echo e(Form::open(['route' => ['whydelivery.store'], 'method' => 'post','enctype' => 'multipart/form-data', 'id' => 'whydelivery_form'])); ?>

<?php endif; ?>
<?php echo Form::hidden('type', 'why_choose'); ?>

<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
    <div class="modal-content">
        <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel"><?php echo e(__($pageTitle)); ?></h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
        <div class="modal-body">
            <div class="form-group col-md-12">
                <?php echo e(Form::label('title', __('message.title') . ' <span class="text-danger">*' .  __('message.max_100_character') . '</span>', ['class' => 'form-control-label'], false)); ?>

                <?php echo e(Form::text('title', old('title'), ['placeholder' => __('message.title'), 'class' => 'form-control', 'required', 'maxlength' => '100'])); ?>

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

                <?php echo e(Form::text('subtitle', old('subtitle'), ['placeholder' => __('message.subtitle'), 'class' => 'form-control', 'required', 'maxlength' => '100'])); ?>

                <span class="text-danger" id = "ajax_form_validation_subtitle"></span>
            </div>
            <div class="row ml-1">
                <div class="form-group col-md-4">
                    <?php echo e(Form::label('frontend_data_image', __('message.image'), ['class' => 'form-control-label'])); ?>

                    <div class="custom-file">
                        <?php echo e(Form::file('frontend_data_image', ['class' => 'custom-file-input', 'id' => 'frontend_data_image', 'lang' => 'en', 'accept' => 'image/*'])); ?>

                        <label class="custom-file-label"
                            for="frontend_data_image"><?php echo e(__('message.choose_file', ['file' => __('message.image')])); ?></label>

                    </div>
                </div>
                <div class="col-md-2 mb-2">
                    <?php if(isset($id) && getMediaFileExit($data, 'frontend_data_image')): ?>
                        <img src="<?php echo e(getSingleMedia($data, 'frontend_data_image' ?? 'images/default.png')); ?>"
                             alt="image" class="attachment-image mt-1">
                    <?php endif; ?>
                </div>
            </div>
        </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-md btn-secondary" data-dismiss="modal"><?php echo e(__('message.close')); ?></button>
                <button type="submit" class="btn btn-md btn-primary" id="btn_submit" data-form="ajax-submite-jquery-validation"><?php echo e(isset($id) ? __('message.update') : __('message.save')); ?></button>
            </div>
        </div>
    </div>
<?php echo e(Form::close()); ?>


<?php /**PATH /home/atharvatek/mxunzo.atharvatek.com/resources/views/whydelivery/model.blade.php ENDPATH**/ ?>