<div class="form-group">
    <label for="">{{ $attribute->name }} @if($attribute->unite) ({{ $attribute->unite }}) @endif</label>
    @php
        $values = explode(PHP_EOL, $attribute->value);
    @endphp
    @if($attribute->multi_value == 1)
        @php
            $db_values = explode("|", $db_value);
        @endphp
        @foreach($values as $value)
            <div class="checkbox">
                <label>
                    <input type="checkbox" name="attr-multi-{{ $attribute->id }}[]" value="{{ $value }}" @if(in_array(trim($value), $db_values)) checked="checked" @endif>
                    {{ $value }}
                </label>
            </div>
        @endforeach
    @else
        <select
            name="attr-{{ $attribute->id }}"
            class="form-control"
            @if($attribute->required) required="required" @endif
        >
            <option value=""></option>
            @foreach($values as $value)
                <option @if(trim($value) == trim($db_value)) selected="selected" @endif>{{ $value }}</option>
            @endforeach
        </select>
    @endif
</div>
