I have a <select multiple>
that is filled with information from a table exams , the user selects the exams he wants for a certain function and sends to register in the table Okay.
My questions are:
-
How to display this retrieved data in an edit screen, ie leave the selected tests selected for the selected function.
-
How to make an update to this table function_exams ? Deleting the registered exams of that function and inserting the new ones?
Exams table: id, name, description
Function table: id, name, description
Examination_function_table: id, exam_id, id_functions
<select multiple id="exames" name="exames[]" class="form-control">
@foreach($exames as $exame)
<option value="{{ $exame->id }}">{{ $exame->nome }}</option>
@endforeach
</select>