I am trying to send two arrays to my BD, an array of activities and another array of points !! so the form, and the error that throws me is an array to string conversion
I do not understand why, could you help me?
error 1/2 is:
here the html code:
<select multiple class="form-control" name="detalle.actividad_id" ng-model="puntuacion.detalle.actividad_id" ng-options="actividad.id as actividad.nombre for actividad in actividades | filter:{ circular_id: puntuacion.detalle.circular_id, tipo_a_id: 1}"></select>
<input ng-repeat="actividad in actividades | filter:{ circular_id: puntuacion.detalle.circular_id, tipo_a_id: 1}" type="text" class="form-control" name="detalle.puntos[]" ng-model="puntuacion.detalle.puntos[$index]" placeholder="@{{ actividad.puntuacion }}">
and the code in the laravel driver:
$datos = $request->detalle;
foreach ($datos as $key => $value) {
$d = new Detalle();
$d->puntuacion_id = $puntuacion->id;
$actividad_id = $value;
$d->actividad_id = $request->detalle['actividad_id'];
$puntos = $request->puntos[$key];
$d->puntos = $request->detalle['puntos'];
$d->save();
}
the data I want to be stored per row, so is the structure of the details table, there are several rows that I want to register at once and that is why I use a select multiple and several inputs! but I think the error is in the logic of the controller, can you help me ?? please!