У меня есть блок проверки следующим образом:
$this->validate($request, [
'id' => 'required|string|unique:user,id|max:32',
'email' => 'required|email|max:191',
'name' => 'nullable|string',
'birthDate' => 'nullable|date_format:Y-m-d',
'countryId' => 'nullable|integer',
'city' => 'nullable|string|max:191',
'address' => 'nullable|string',
'zipCode' => 'nullable|string|max:191',
'phone' => 'nullable|string',
]);
Я отправляю данные следующим образом:
{
"id": "nJy8zWQ6VuptDFNA",
"email": "email@email.com",
"name": "name",
"birthDate": "1980-01-01",
"countryId": 1481,
"city": "a city",
"address": "this is an address",
"zipCode": "123400",
"phone": 09876554321
}
Я отправляю поле phone какнеправильный тип данных.Тогда ответ выглядит так, что поле phone имеет неправильный тип.
Но я получаю такой ответ:
{
"id": [
"The id field is required."
],
"email": [
"The email field is required."
]
}
Я не могу найти проблему здесь.