Combobox with yes and no on laravel

1

I have a combobox that has the values yes and no. It is bringing the value not that I put in the bank but in the form of edit does not appear the other option that in the case would be the sim. How do I make the opposite option appear?

<select name="disponivel_venda" class="form-control">
    @foreach($properties as $value)
        <option {{$property->disponivel_venda == $value->disponivel_venda ? 'selected' : '' }}  value="{{ $value->disponivel_venda }}">{{$value->disponivel_venda}}</option>
    @endforeach
</select>
    
asked by anonymous 24.11.2016 / 14:47

1 answer

1

Basically this would be it:

<select name="disponivel_venda" class="form-control">
    <option {{$property->disponivel_venda=='Sim'?' selected':''}}>Sim</option>
    <option {{$property->disponivel_venda!='Sim'?' selected':''}}>Não</option>
</select>
    
24.11.2016 / 15:17