Error: The image must be a file of type: jpeg, png, jpg, gif, svg.
I have this error when i try to upload image from the form, the image is .jpeg and i think it should work beacuse 'image'should be 'required|mimes:jpeg,png,jpg,gif,svg|max:2048'
My Controller
public function store(){
$this->validate(request(),[
'title' => 'required',
'image' => 'required|mimes:jpeg,png,jpg,gif,svg|max:2048',
'body' => 'required',
]);
auth()->user()->publish(
new Post(request(['title','image','body']))
);
session()->flash('message', 'your post has now been published');
return redirect('/');
}
** My BLADE**
<form method="POST" action="/posts">
{{csrf_field()}}
<div class="form-group">
<label for="title">Titolo</label>
<input type="text" class="form-control" id="title" name="title">
</div>
<div class="form-group">
<label for="image">Immagine</label>
<input type="file" class="form-control" id="image" name="image">
</div>
<div class="form-group">
<label for="body">Corpo</label>
<textarea id="body" name="body" class="form-control"></textarea>
</div>
<div class="form-group">
<button type="submit" class="bottone">Invia</button>
</div>
@include ('layouts.errors')
</form>