📜  验证忽略规则 - PHP 代码示例

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

代码示例1
public function rules(Request $request)
    {
        return [
            'first_name' => 'required|string',
            'last_name' => 'required|string',
            'email' => ['required','email', 'string', Rule::unique('users')->ignore($request->user_id )],
            'phone_number' => ['required', 'string', Rule::unique('users')->ignore($request->user_id )],
        ];
    }