original_string: public static function withMessages(array $messages)
      {
          return new static(tap(ValidatorFacade::make([], []), function ($validator) use ($messages) {
              foreach ($messages as $key => $value) {
                  foreach (Arr::wrap($value) as $message) {
                      $validator->errors()->add($key, $message);
                  }
              }
          }));
      }
code: public static function withMessages(array $messages)
      {
          return new static(tap(ValidatorFacade::make([], []), function ($validator) use ($messages) {
              foreach ($messages as $key => $value) {
                  foreach (Arr::wrap($value) as $message) {
                      $validator->errors()->add($key, $message);
                  }
              }
          }));
      }
code_tokens: public static function withMessages ( array $ messages ) { return new static ( tap ( ValidatorFacade :: make ( [ ] , [ ] ) , function ( $ validator ) use ( $ messages ) { foreach ( $ messages as $ key => $ value ) { foreach ( Arr :: wrap ( $ value ) as $ message ) { $ validator -> errors ( ) -> add ( $ key , $ message ) ; } } } ) ) ; }
docstring: Create a new validation exception from a plain array of messages.
  
  @param  array  $messages
  @return static
docstring_tokens: Create a new validation exception from a plain array of messages .