I'm working the Laravel 5.5.
I have a table called servers, in this table I insert both physical and virtual servers, and identify them through the following field.
{!! Form::mySelect('id_uso', 'Uso', [0 => 'Escoge una opción'] + App\Usos::pluck('nombre', 'id')->toArray(), null, ['id' => 'listaUsos', 'class'=>'chosen']) !!}
And I have another field called Parent Server, which lists the servers that are in the same table.
{!! Form::mySelect('id_padre', 'Servidor padre', App\Servidores::pluck('nombre', 'id')->toArray(), null, ['class'=>'chosen']) !!}
The problem is that if in the Use field the Virtual option is chosen, In the Server Parent field you should only list the name of the servers listed as Physical.
Could someone tell me how to do it?
Try to make a CONCAT, so that when choosing the value of the drop-down list, it will bring the ID of whether it is physical or virtual, to be able to identify it, but clearly it is not practical, and I would like to learn how to make that particular query.