I have a form looking like this:
{{ Form::open(array('route' => 'notebook.store', 'files' => true)) }}
{{ Form::text('title', null, [
'class'=>'form-control',
'placeholder'=>'Title',
]) }}
<br>
{{ Form::text('description', null, [
'class'=>'form-control',
'placeholder' => 'Desc',
])}}
<br>
{{ Form::file('path') }}
<br>
{{ Form::submit('Save', [
'class' => 'btn btn-primary btn-lg pull-right'
]) }}
<br><br>
{{ Form::close()}}
The problem is that Input::all()
in my controller returns an empty array if that 'files'=>true
is in the form description, when I remove it, the problem goes away and Input::all()
returns the usual, expected input.
Edit- I found out what the problem was. My server had terribly low post_max_size in php.ini, and apparently it clears all your post/get data if the file exceeds that limit.
Use this:
{{ Form::open(array('route' => 'notebook.store', 'enctype' => 'multipart/form-data')) }}
For any reason this:
{{ Form::open(array('route' => 'notebook.store', 'files' => true)) }}
does not work!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With