'require|unique:sys_user', 'real_name' => 'requireWithout:field|requireIf:field,real_name', 'password' => 'require', ]; protected $message = [ 'username.require' => 'validate_user.username_require', 'username.unique' => 'validate_user.username_unique', 'username.max' => 'validate_user.username_max', 'real_name.requireWithout' => 'validate_user.real_name_require', 'real_name.requireIf' => 'validate_user.real_name_require', 'password.require' => 'validate_user.password_require', ]; protected $scene = [ 'add' => ['username', 'password'], 'edit' => [], 'modify' => [] ]; }