0
I’m using form::model
for data editing. It works correctly but checkbox returns empty. How do I return the ones saved in bd?
I want them to show the ones who are registered. For example: in the course registration I marked Morning and Afternoon, so in the edition you have to return the two marked and one void, in the case Night.
[v] Morning [v] Evening [ ] Evening
View Edit:
{{ Form::model($curso, array('method' => 'PATCH', 'route' => array('painel.cursos.update', $curso->id))) }}
<label>{{ Form::checkbox( 'turnos[0]', 'Manhã') }} Manhã</label>
<label>{{ Form::checkbox( 'turnos[1]', 'Tarde') }} Tarde</label>
<label>{{ Form::checkbox( 'turnos[2]', 'Noite') }} Noite</label>
{{ Form::close() }}
So they return empty.
Already in this way resume only saved in the comic:
<?php $course = explode(",", $curso->turno);?>
@foreach ($course as $c)
<label>{{ Form::checkbox('turnos[]', $c, true) }} {{$c}}</label>
@endforeach
I don’t know how to do this.