示例#1
0
 /**
  * Validate the given message request with the given rules.
  *
  * @param  \App\WS\Message $message
  * @param  array $rules
  * @param  array $messages
  * @param  array $customAttributes
  * @return void
  */
 public function validate($message, array $rules, array $messages = [], array $customAttributes = [])
 {
     $validator = $this->getValidationFactory()->make($message->all(), $rules, $messages, $customAttributes);
     if ($validator->fails()) {
         throw new ValidationException($validator, $this->formatValidationErrors($validator));
     }
 }