Form Request Get Only Fields with Validation Rules
I am using a form request to help with a form wizard where a user fills out fields across multiple steps. I'm trying to use a single form request for the store and the update. How can I get only the input fields that have validation rules? I've looked into request()->only() but you need to specify an array of form fields, when doing updates on my wizard a user only updates a single page at a time so the fields that I want to request would change for each page they update. Here's an example of my validation rules:
If a user is updating just step 2 I want my request to only return field_4. Is there a method on the Request class to limit the fields just based on ones that have validation rules?
Thanks, the problem isn't the validation, the problem is the request array returns all the fields passed to it regardless if they're in the validation rules or not. I'm trying to limit that array based just on fields which are under validation. I can manually do this with the only() function but then I have to explicitly list the fields that I want, I'm trying to find a better way by just using whatever fields are defined in the validation rules array.