<?php
use Illuminate\Support\Str;
$fkClass = $references[0];
$fkKey = $references[1];
$fkLabel = $references[2];

$listes =  $fkClass::select('*')->get();

$refModel = new $fkClass();
$refKey = $refModel->getPrimaryKey();

?>
<div class="<?php echo e($div_class); ?>">
    <div class="form-group">
        <label for="<?php echo e($fkKey); ?>" class="control-label"><?php echo e($title); ?></label>
        <select  class="form-control select2" name="<?php echo e($fkKey); ?>" id="<?php echo e($fkKey); ?>">
            <option value="">*Choisir</option>
            <?php $__currentLoopData = $listes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $liste): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php
                 if(Str::endsWith($fkLabel, '()')){
                     $func = Str::substr($fkLabel, 0, Str::length($fkLabel)-2);
                     $text = $liste->$func();
                 }else{
                    $text = $liste->$fkLabel;
                 }
                ?>
                <option <?php if(old($fkKey,$model->$fkKey)==$liste->$refKey): ?> selected <?php endif; ?> value="<?php echo e($liste->$refKey); ?>"><?php echo e($text); ?></option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
    </div>
</div>


<?php /**PATH C:\Users\UTILISATEUR\Desktop\Fidelisations\loyalty-system\loyalty-app\resources\views/inc/cruds/inputs/select_from_model.blade.php ENDPATH**/ ?>