使用Laravel Form Request Validation,
如何自定義響應格式?
例如,它顯示錯誤信息爲: -Laravel請求確認消息格式化
{
"password": ["The password field is required."],
"password_confirmation": ["The password confirmation field is required."]
}
我希望把所有的錯誤信息到描述屬性,有點像。
{
"status" : false,
"description" : ["The password field is required.", "The password confirmation field is required."]
}