I have a form that has multiple form file uploads - 6. So it looks like this :
<div class='form-group'>
<div class='row'>
<div class='col-md-12'>
<div class='btn btn-info btn-md'>
{!!Form::file('image-1')!!}
</div>
</div>
</div>
</div>
<div class='form-group'>
<div class='row'>
<div class='col-md-12'>
<div class='btn btn-info btn-md'>
{!!Form::file('image-2')!!}
</div>
</div>
</div>
</div>
In my controller, I don't want to have to do
if(Input::hasFile('image-1')||Input::hasFile('image-2')|| etc) {
//code
}
plus each new image is a new row in my DB. I REALLY don't want to do
$image-1 = Image::create(); $image-2 = Image::create();
I guess for this I could throw everything into a array and loop through it, creating a object through each iteration...But I would still need to create an array with all the input objects which is annoying. Please show the way O_O