In your controller method dd the request and see what you get, and share that here.
Jun 8, 2022
3
Level 1
Axios.put give me The given data was invalid
I send this object:
created_at: "2022-06-08T09:59:40.000000Z"
description: "dddd"
end_downtime: "2022-06-15T12:59:34.000000Z"
id: 6
init_downtime: "2022-06-15T09:59:34.000000Z"
title: "ddddddddddddsasa"
updated_at: "2022-06-08T09:59:40.000000Z"
via an axios.put call
when it arrives in the controller it must respect the request I made as follows:
public function rules()
{
return [
'title' => 'required|string',
'description' => 'required|string',
'init_downtime' => 'required|date',
'end_downtime' => 'required|date|after:init_downtime'
];
}
I just get the following 422 error (422 (Unprocessable Content):
{message: "The given data was invalid.",…}
title: ["Il campo title è obbligatorio."]
I don't understand why, give me this error since the data is there, clearly if I put a generic request it enters the controller etc, but I don't understand. It seems that the specified fields arrive empty but they arrive it's strange
Please or to participate in this conversation.