📌  相关文章
📜  在 laravel 表单验证错误消息中给出自定义字段名称 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:11.445000             🧑  作者: Mango

代码示例4
$rules = [
        'name' => 'required',
        'email' => 'required|email',
        'message' => 'required|max:250',
    ];

    $customMessages = [
        'required' => 'The :attribute field is required.'
    ];

    $this->validate($request, $rules, $customMessages);
//@sujay