mercredi 31 janvier 2018

how to store values ​of a multiple select in a field as a string of characters in laravel

{!! Form::open(['route'=>'diagnostic.store']) !!} 
this is my sight:

<select class="form-control" multiple="multiple" name="diagnóstico_rela" id="person3">
  <option selected="selected">orange</option>
  <option>white</option>
  <option selected="selected">purple</option>
</select>
<script>


$("#person3").select2({

    tags: true,


})


</script>

{!! Form::close() !!}

this is my controller:

$diagnosticRear_segment = new Rear_segment;
$diagnosticRear_segment->conducta = $request->conducta;
 $diagnosticRear_segment->principal_diagnostic_id = $request->principal_diagnostic_id;
 $diagnosticRear_segment->diagnóstico_rela = $request->diagnóstico_rela;
 $diagnosticRear_segment->ultimo_ontrol = $request->ultimo_ontrol;
 $diagnosticRear_segment->próximo_control = $request->próximo_control;
                 $diagnosticRear_segment->save();

I am new in this I thank you for the help provided.

In the controller, I show all the fields that I keep in that table in the single that in the view I am showing the field that causes me the problem.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2BFRHQH
via IFTTT

Aucun commentaire:

Enregistrer un commentaire