'valid_contacts', ]; } public function validator($factory) { // support submiting the form with a single client record $input = $this->input(); if (isset($input['contact'])) { $input['contacts'] = [$input['contact']]; unset($input['contact']); $this->replace($input); } return $factory->make( $this->input(), $this->container->call([$this, 'rules']), $this->messages() ); } }