I'm working on laravel 5.5
I have these two lists:
1- The first is a list of operating systems
{!! Form::mySelect('id_so', 'Sistema Operativo', App\SistemasOperativos::pluck('nombre', 'id')->toArray(), null, ['class'=>'chosen', 'placeholder' => 'Escoge una opción']) !!}
2- The second one, you should list the versions according to the operating system
{!! Form::mySelect('id_version',
'Version S.O:',
App\SoVersiones::select(DB::raw("version AS version"), "id","id_so")->where('id', '=', 1)-> pluck('version', 'id','id_so')->toArray(),
null,
['class'=>'chosen', 'placeholder' => 'Escoge una opción']) !!}
I got to this point, since it brings me the versions because I call them with an integer value, A value burned in the Form, but I can not find the way to bring the value of the first mySelect so that it compares with the vlaor that I am burning and so, the query is successful.
Attached image
Could someone help me?
Thanks for reading, happy day.
EDIT:
Hi, I managed to bring the value of the first field into a variable, but at the time of making the comparison it gives me an error.
First List:
{!! Form::mySelect('id_so', 'Sistema Operativo:',$worktypes_list= App\SistemasOperativos::pluck('id', 'nombre')->toArray() , null, ['class'=>'chosen', 'placeholder' => 'Escoge una opción']) !!}
Second list:
{!! Form::mySelect('id_version',
'Version S.O:',
App\SoVersiones::select(DB::raw("version AS version"), "id_so")->where('id', '=', $worktypes_list)-> pluck('version', 'id_so')->toArray(),
null,
['class'=>'chosen', 'placeholder' => 'Escoge una opción']) !!}
But I get this error:
When the ID's could match, The problem I see is that you are doing the query once, instead of throwing values as soon as you select some value from the first field, How could you correct this?
Thanks for reading.