Input::file() returning null Laravel
I had the same problem in a normal form. I forgot to add:
enctype="multipart/form-data"
I had the same issue and realised I had left out something in the form. Use the built in laravel forms as it will automatically add CRSF protection (see http://laravel.com/docs/html). Anyway - you need to add 'files' => true
to the top of the form - so for example in the blade template it could look like:
{{ Form::open( array('route' => 'admin.store', 'class'=>'form-horizontal', 'files' => true)) }}
{{Form::file('file')}}
{{ Form::submit('Submit', array('class' => 'btn btn-info')) }}
{{ Form::close() }}
Looking at your code, it should work, so it looks you have a problem in anything else, maybe even your view. I just built two routers to test it here:
Route::post('file', function() {
echo "<pre>";
var_dump(Input::file('profile'));
echo "</pre>";
});
Route::get('upload', function() {
return Form::open(array('url' => '/file', 'files' => true)) .
Form::file('profile') .
Form::submit('upload');
});
You can use them as a baseline to, step-by-step, make yours work too.