I am designing a e-commerce website and right now I'm working on the admin panel. I need to upload a file and when I do it fails. All I get is a redirect to the form. My databases doesn’t update either. What am I doing wrong?
Controller:
Item::create($request->all());
if (Input::hasFile('filename')) {
$file = $request->file('filename');
$file->move('uploads', $file->getClientOriginalName());
echo "File Uploaded";
}```
View
<hr />
<content>
<div class="form-group">
{!! Form::open(['route' => 'item.store', 'files' => true]) !!}
{!! Form::label('name', "Name") !!}
{!! Form::text('name', null, ['class' => 'form-control']) !!}
{!! Form::label('filename', "File Name") !!}
{!! Form::file('filename', null, ['class' => 'form-control']) !!}
{!! Form::label('description', 'Description') !!}
{!! Form::textarea('description', null, ['class' => 'form-control']) !!}
{!! Form::submit('Add Item', ['class' => 'btn btn-primary form-control']) !!}
</content>
</div>```