📜  在验证 laravel 8 中更改字段名称 - PHP 代码示例

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

代码示例1
$this->validate([ // 1st array is field rules
  'userid' =>'required|min:3|max:100',
  'username' =>'required|min:3',
  'password' =>'required|max:15|confirmed',
], [ // 2nd array is the rules custom message
  'required' => 'The :attribute field is mandatory.'
], [ // 3rd array is the fields custom name
  'userid' => 'User ID'
]);