Hola amigos no me funciona Input::old() no funciona en un array
Formulario
Código PHP:
Ver original{{ Form
::open(array('route' => 'performances.store')) }} @for($i=0; $i<=5; $i++)
Inicio
{{ Form::text('inicio[]') }}<br>
Fin
{{ Form::text('porcentaje[]',Input::old('porcentaje')) }}<br>
@endfor
{{ Form
::submit('Guardar', array('class' => 'btn btn-info')) }} {{ Form::close() }}
@if ($errors->any())
<ul>
{{ implode('', $errors->all('<li class="error">:message</li>')) }} </ul>
@endif
Controlador
Código PHP:
Ver originalpublic function store()
{
$porcentaje = Input::get('porcentaje');
foreach ($porcentaje as $key => $value) {
$validator = Validator::make(
array('porcentaje' => $value), array('porcentaje' => array('required','numeric','between:0,100')) );
}
if ($validator->fails())
{
return Redirect::back()->withErrors($validator)->withInput();
}
return View
::make('performances.satisfactorio',compact('usuario','inicio_turno')); }
Obtengo este error:
Cita:
ErrorException
htmlentities() expects parameter 1 to be string, array given