Chron
2 months ago
264
2
Laravel

Is there a way to validate a form as a group?

Posted 2 months ago by Chron

For example, I have the input for name, age, role

Is there a way in form request to validate these fields as a group? Right now, I'm doing it like this:

'name' => ['required', new ValidationEx($this->name, $this->age, $this->role)],
'age' => ['required', new ValidationEx($this->name, $this->age, $this->role)],
'role' => ['required', new ValidationEx($this->name, $this->age, $this->role)],

Please sign in or create an account to participate in this conversation.