<?php
    $handelNameForLaravelTranslatable = str_replace('[', '-', $name);
    $handelNameForLaravelTranslatable = str_replace(']', '-lara-trans-error', $handelNameForLaravelTranslatable);
?>
<div class="form-group <?php echo e($formGroupClass); ?>">
    <?php if($label == true): ?>
        <label
            <?php $__currentLoopData = $labelOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if(is_numeric($key)): ?> <?php echo e($val); ?> <?php else: ?> <?php echo $key.'="'.$val.'"'; ?> <?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>><?php echo $labelText; ?></label>
    <?php endif; ?>



    <?php if($input == true): ?>
        <input type="<?php echo e($type); ?>" name="<?php echo e($name); ?>" value="<?php echo e($value); ?>"
            <?php if(strstr($name, '[]')): ?> <?php echo e('data-name=' . str_replace('[]', '', $name)); ?> <?php endif; ?>
            <?php echo e('data-laravel-translatable=' . $handelNameForLaravelTranslatable); ?>

            <?php $__currentLoopData = $inputOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(is_numeric($key)): ?><?php echo $val; ?><?php else: ?> <?php echo $key . '="' . $val . '"'; ?> <?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>>
    <?php endif; ?>



    <?php if($textarea == true): ?>
        <textarea name="<?php echo e($name); ?>" id="<?php echo e($name); ?>"
            <?php if(strstr($name, '[]')): ?> <?php echo e('data-name=' . str_replace('[]', '', $name)); ?> <?php endif; ?>
            <?php echo e('data-laravel-translatable=' . $handelNameForLaravelTranslatable); ?>

            <?php $__currentLoopData = $textareaOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if(is_numeric($key)): ?> <?php echo $val; ?> <?php else: ?> <?php echo $key . '="' . $val . '"'; ?> <?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>><?php
                echo $value;
            ?></textarea>
    <?php endif; ?>


    <?php if($select == true): ?>

        <?php
            $option_value = null;
            $option_text = null;
        ?>

        <select name="<?php echo e($name); ?>" id="<?php echo e($name); ?>"
            <?php if(strstr($name, '[]')): ?> <?php echo e('data-name=' . str_replace('[]', '', $name)); ?> <?php endif; ?>
            <?php $__currentLoopData = $selectOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if(is_numeric($key)): ?> <?php echo $val; ?> <?php else: ?> <?php echo $key . '="' . $val . '"'; ?> <?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>>

            <!-- $arrayType == 'associative' -->
            <?php if(isset($list[0]) && is_array($list[0])): ?>

                <?php $__currentLoopData = $list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <!-- Check IF Not Have Selected Value Set Empty Option In First -->
                    <?php

                        if (is_array($val)) {
                            if (isset($val[$optionValue]) && isset($val[$optionText])) {
                                // Option Value
                                $option_value = $val[$optionValue];
                                $option_text = $val[$optionText];
                            } else {
                                $error =
                                    'Error Make sure you include the following information: <br> value => not exist <br> OR <br> name => not exist';
                            }
                        } else {
                            $option_value = $val;
                            $option_text = $val;
                        }
                        // IF Have Request Set The Old Value Selected
                        if (old($name) != null) {
                            $selected = old($name);
                        }

                    ?>

                    <?php if(!$selected): ?>
                        <?php if($loop->index == 0): ?>
                            <option value="" selected disabled>
                                <?php if(isset($selectOptions['placeholder'])): ?>
                                    <?php echo e($selectOptions['placeholder']); ?>

                                <?php else: ?>
                                    <?php echo e(__('choose')); ?>

                                <?php endif; ?>
                            </option>
                        <?php endif; ?>
                    <?php endif; ?>

                    <option <?php if($selected == $option_value): echo 'selected'; endif; ?> value="<?php echo e($option_value); ?>">
                        <?php echo e(Str::ucfirst($option_text)); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php else: ?>
                <?php $__currentLoopData = $list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $opt): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <!-- Check IF Not Have Selected Value Set Empty Option In First -->
                    <?php

                        if (isset($opt->$optionValue)) {
                            // Option Value
                            $option_value = $opt->$optionValue;
                            //  Option Text For Display
                            $option_text = $opt->$optionText;
                        } else {
                            // Option Value
                            $option_value = $opt;
                            // Option Text For Display
                            $option_text = $opt;
                        }

                        // IF Have Request Set The Old Value Selected
                        if (old($name) != null) {
                            $selected = old($name);
                        }

                    ?>

                    <?php if(!$selected): ?>
                        <?php if($loop->index == 0): ?>
                            <option value="" selected disabled>
                                <?php if(isset($selectOptions['placeholder'])): ?>
                                    <?php echo e($selectOptions['placeholder']); ?>

                                <?php else: ?>
                                    <?php echo e(__('choose')); ?>

                                <?php endif; ?>
                            </option>
                        <?php endif; ?>
                    <?php endif; ?>

                    <option <?php if($selected == $option_value): echo 'selected'; endif; ?> value="<?php echo e($option_value); ?>">
                        <?php echo e(Str::ucfirst($option_text)); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php endif; ?>



        </select>

    <?php endif; ?>


    <?php $__errorArgs = [$name];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
        <span class="error"><?php echo e($message); ?></span>
    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>

    <?php if($error != null): ?>
        <div class="alert alert-danger"><?php echo $error; ?></div>
    <?php endif; ?>

</div><!-- End FormGroup -->
<?php /**PATH C:\xampp\htdocs\wjhatna\resources\views/components/form-group.blade.php ENDPATH**/ ?>