What seems to be the problem: I am hoping to use the prepareForValidation() method within a livewire component.
Steps to Reproduce: I want to modify some of the request data before validation, in a standard laravel FormRequest i use the prepareForValidation() method.
In livewire I have tried this, livewire throws an error and says i must follow the prepareForValidation($attributes), which I have applied. If I put a dd($attributes) I can see the contents of the request, however at this point I am not sure how to go about modifying that data, in the laravel form request I would simply have $this->merge([]); within the prepareForValidation() method.
In this case $attributes is an array not a collection. so merge() isn’t useable.
I have tried simply modifying and returning the attribute i require modifying but this doesnt work as it throws errors on the other attributes that haven’t been modified.
I am just curious as to whether there is a standard way of doing this in a livewire component as i can’t see anything in the documents.
Are you using the latest version of Livewire: Yes
Do you have any screenshots or code examples: Yes