/** * Create a new validation exception instance. * * @param \Illuminate\Contracts\Support\MessageProvider $provider */ public function __construct(MessageProvider $provider) { parent::__construct($provider); foreach ($this->errors()->getMessageBag()->all() as $error) { $this->message .= $error . "\n"; } }
/** * @param array $failed failed message array * @param string $message a global message * @param int $code * @param Exception|null $previous */ public function __construct($failed = [], $message = '', $code = 0, Exception $previous = null) { parent::__construct($message, $code, $previous); $this->failed = $failed; }
/** * Format the errors from the given Validator instance. * * @param \Illuminate\Validation\Validator $validator * @return array */ protected function formatErrors(ValidationException $exception) { return $exception->errors()->getMessages(); }