Skip to content

Validation using Password::required() succeeds even when the value is missing #58112

@KaNiShi

Description

@KaNiShi

Laravel Version

12.42.0

PHP Version

8.4.14

Database Driver & Version

No response

Description

When performing validation using Password::required(), it succeeds even when the value is missing, as shown in the reproduction steps.
This is likely because the passes method is not called when the value does not exist.

I have verified that this problem isn't present in version v12.41.1 but is in v12.42.0.
Consequently, the modifications in #58034 might be influencing this outcome.

Steps To Reproduce

Validator::make(
    [],
    [
        'password' => [\Illuminate\Validation\Rules\Password::required()],
    ],
)->passes(); // Expected: false, Actual: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions