I want to upload an image file using
{!! Form::open(['url'=>'admins']) !!}
{!! Form::input('file','photo',null,['class'=>'photo_input']) !!}
Also my validation rules are
public function rules()
{
return [
'username'=>'required|max:127|min:3|unique:users,username,'.$this->username,
'email'=>'required|max:127|email|min:3|unique:users,email,'.$this->email,
'password'=>'required|max:127|min:5|confirmed',
'password_confirmation'=>'required|max:127|min:5|',
'role'=>'required|max:127|min:5|in:programmer,admin,employee',
'photo' => 'mimes:jpg,jpeg,bmp,png,gif'
];
}
But I get an error
The photo must be a file of type: jpg, jpeg, bmp, png, gif.
Whereas the file extension which I choose is jpg, so what's wrong?
form
tags. – Jerodev