Laravel version: 8.82.0
I am uploading an image with inertiajs by making a post request with form.post method. An image data is received in controller as depicted in an image below:
My simplified controller:
public function store(){
Request()->validate([
'thumbnail' => 'required|mimes:png,jpeg,jpg|max:2048'
// Also tried, still fails.
// 'thumbnail' => 'required|image|mimes:png,jpeg,jpg|max:2048'
]);
return Redirect::route('showcases.index');
}
Upon ariving header content-type is application/json, I tried changing it to multipart/form-data but to no avail, image validation still fails.
The error I get is: The thumbnail must be a file of type: png, jpeg, jpg
