Skip to content

Replacing/Merging inside FormRequest passedValidation doesn't work as intended. #57659

@JesterIruka

Description

@JesterIruka

Laravel Version

12.36.1

PHP Version

8.4.13

Database Driver & Version

No database

Description

Inside the FormRequest instance, using $this->replace([]) does not work as intended.
The return value from $request->validated() in the controller is different from what is expected.
Instead, the data remains exactly the same as before calling passedValidation().

This behavior doesn't affect prepareForValidation().

Steps To Reproduce

https://github.com/JesterIruka/laravel-passed-validation-bug

Edit: run php artisan test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions