<style>
    .detail-content .row{
        padding: 0;
        margin: 10px 0;
    }
</style>

<?php
$selectsKeyValues = $model->getSelectsKeyValues();
$customs_columns =$model->getCustomColumns();
?>



@if(!in_array($name,$model->getFieldsHiddens()))
    <div class="detail-content">
        @if(in_array($name,$model->getDates()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{\App\Agbonon::date('d-m-Y',$model->$name)}}</div>
            </div>
        @elseif(in_array($name,array_keys($selectsKeyValues)))
            <?php
            $valueMmodel = $selectsKeyValues[$name];
            $value=null;
            if(class_exists($valueMmodel))
                $value = $valueMmodel::find($model->$name)
            ?>
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">@if($value!=null){{$value->name}}@else{{$model->$name}}@endif</div>
            </div>
        @elseif(in_array($name,array_keys($model->getFormCustomHtml())))
            @include('inc.cruds.custom_html')
        @elseif(in_array($name,$model->getSeparators()))
            @include('inc.cruds.separator')
        @elseif(in_array($name,$model->getColors()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(in_array($name,$model->getDatetimes()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{\App\Agbonon::date('d-m-Y H:i:s',$model->$name)}}</div>
            </div>
        @elseif(in_array($name,array_keys($model->getSelectsMultiple())))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">
                    @foreach($model->$name as $e)
                        <span class="label  label-purple">{{$e->name}}</span>
                    @endforeach
                </div>
            </div>
        @elseif(in_array($name,$model->getDatesRange()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(in_array($name,$model->getDatetimesRange()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(in_array($name,$model->getImages()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(in_array($name,$model->getTimes()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(in_array($name,$model->getLongTexts()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(in_array($name,$model->getEmails()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(in_array($name,$model->getTelephones()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(in_array($name,array_keys($model->getBelongsTo())))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">
                    <?php  $relation_column=$model->getBelongsTo()[$name]; ?>
                    @if($model->$name!=null){{$model->$name->$relation_column}}@endif
                </div>
            </div>
        @elseif(in_array($name,array_keys($model->getSelects())))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(in_array($name,$model->getFiles()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(in_array($name,$model->getRichTexts()))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>
        @elseif(array_key_exists($name,$customs_columns))
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value"> {!! $model->$customs_columns[$name]() !!}</div>
            </div>
        @else
            <div class="row">
                <div class="col-sm-5 detail-label">{{$title}}</div>
                <div class="col-sm-7 detail-value">{{$model->$name}}</div>
            </div>

        @endif
    </div>
@endif