コード例 #1
0
 /**
  * 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";
     }
 }
コード例 #2
0
 /**
  * @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;
 }
コード例 #3
0
ファイル: SearchRequest.php プロジェクト: realholgi/cmsable
 /**
  * Format the errors from the given Validator instance.
  *
  * @param  \Illuminate\Validation\Validator  $validator
  * @return array
  */
 protected function formatErrors(ValidationException $exception)
 {
     return $exception->errors()->getMessages();
 }