You see, I have a table with these values:
Schema::create('contenidos', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
});
I group all the rows in a vector called $ contents and use them for a form in the following way:
<div>
<b><i><u>Habilidades requeridas:</u></i></b><br><br>
@foreach($contenidos as $contenido)
<input type="checkbox" name="capacidad[]" value="{{$contenido->id}}" {{ (is_array(old('capacidad')) and in_array(1, old('capacidad'))) ? ' checked' : '' }}> {{$contenido->nombre}}<br>
@endforeach
</div>
What I want is that if an error occurs introducing the data of the form it is kept that icons were marked, but I find that every time that the form is restarted due to data not validated unlike the text boxes the checkboxes they are again unmarked. How do I solve this?