It is difficult to find a title that details. step to explain.
I have a form where I enter up to 5 images. But only the first one requires it if or if (as the main image of the article). The other 4 are optional. These images are entered with inputs
What I need to do is that by php or by validation of the request, I would prefer the latter, do not allow me to enter an image of any input, but keep the order, first the input of the main image, then the second that is already optional and so until the last one if you want to
@section('contenido')
{!! Form::open(['route'=>'articulos.store','method'=>'POST','files'=>true]) !!}
<br>
<div class="form-group">
{!! Form::label('imagen_1','Imagen Principal:') !!}
{!! Form::file('imagen_1') !!}
<br>
{!! Form::text('descripcion_1',null,['class'=>'form-control','placeholder'=>'Descripcion de la foto...']) !!}
</div>
<div class="form-group">
{!! Form::label('imagen_2','Imagen 2:') !!}
{!! Form::file('imagen_2') !!}
<br>
{!! Form::text('descripcion_2',null,['class'=>'form-control','placeholder'=>'Descripcion de la foto...']) !!}
</div>
<div class="form-group">
{!! Form::label('imagen_3','Imagen 3:') !!}
{!! Form::file('imagen_3') !!}
<br>
{!! Form::text('descripcion_3',null,['class'=>'form-control','placeholder'=>'Descripcion de la foto...']) !!}
</div>
<div class="form-group">
{!! Form::label('imagen_4','Imagen 4:') !!}
{!! Form::file('imagen_4') !!}
<br>
{!! Form::text('descripcion_4',null,['class'=>'form-control','placeholder'=>'Descripcion de la foto...']) !!}
</div>
<div class="form-group">
{!! Form::label('imagen_5','Imagen 5:') !!}
{!! Form::file('imagen_5') !!}
<br>
{!! Form::text('descripcion_5',null,['class'=>'form-control','placeholder'=>'Descripcion de la foto...']) !!}
</div>
<div class="form-group">
{!! Form::submit('Agregar articulo',['class'=>'btn btn-primary']) !!}
</div>
{!! Form::close() !!}
@endsection