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);
                }
            }
        }));
    }
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);
                }
            }
        }));
    }
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 ) ; } } } ) ) ; }
Create a new validation exception from a plain array of messages.

@param  array  $messages
@return static
Create a new validation exception from a plain array of messages .