I don't know where do I doing wrong the file not uploaded and the name not store in database.
Here's my controller
if(Input::hasFile('photo')) {
$fotoName = 'peg' . $employee->id . '.' .
$request->file('photo')->getClientOriginalExtension();
$request->file('photo')->move(
base_path() . '/public/images/employee/', $fotoName
);
$img = Image::make(base_path() . '/public/images/employee/' . $fotoName);
$img->resize(150, null, function ($constraint) {
$constraint->aspectRatio();
});
$img->save();
$employee_fotos = Karyawan::find($employee->id);
$employee_fotos->photo = $fotoName;
$employee_fotos->save();
}
Views
<form class="form-horizontal" role="form" action="{{ route("karyawan.store") }}" method="post" multiple>
{{ csrf_field() }}
<div class="row">
<!-- left column -->
<div class="col-md-3">
<div class="text-center">
<img src="//placehold.it/100" class="avatar img-circle" alt="avatar">
<h6>Upload a different photo...</h6>
<input type="file" name="photo" class="form-control" />
</div>
</div>
</form>
and I dont get any error and if I make validate its always get please add image or make sure the file extention .jpg etc, for sure I have choice a right image and extention