📜  如何在 laravel 中更改验证消息 - PHP 代码示例

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

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

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

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