Can you post your method in the API, and the data you are sending via postman please?
laravel doesn't validate 'form-data' request?
I'm doing some rest API. I need a form with some text fields and one image upload field but I have a problem with validating it.
return [ 'title' => 'required|max:200|regex:/^[a-zA-Z0-9\s]+$/', 'pagetitle' => 'required|max:200', 'image' => 'file|required|mimes:png,jpg,jpeg' ];
When I'm sending the request as 'form-data' in the Postman, Laravel doesn't see in the validation any fields (why?).
Response none of fields validated even if it's send to Laravel
"success": false, "message": "The given data was invalid.", "errors": { "title": [ "The Title field is required." ], "pagetitle": [ "The Page Title field is required." ], "image": [ "The Page Image field is required." ] }
When I'm sending the request as application/x-www-form-urlencoded Laravel sees my text fields, but I can't, of course, upload the image. (I don't see how to upload image that way in Postman. I think it's not possible)
Please or to participate in this conversation.