all() 공개 메소드

Get all of the messages for every key in the bag.
public all ( string $format = null ) : array
$format string
리턴 array
예제 #1
0
 /**
  * Get the message container for the validator.
  *
  *
  * @return \Overtrue\Support\MessageBag
  */
 public function messages()
 {
     if (!$this->messages) {
         $this->passes();
     }
     return $this->messages->all();
 }
예제 #2
0
 /**
  * Determine if the data passes the validation rules.
  *
  *
  * @return bool
  */
 public function passes()
 {
     $this->messages = new MessageBag();
     // We'll spin through each rule, validating the attributes attached to that
     // rule. Any error messages will be added to the containers with each of
     // the other error messages, returning true if we don't have messages.
     foreach ($this->rules as $attribute => $rules) {
         foreach ($rules as $rule) {
             $this->validate($attribute, $rule);
         }
     }
     // Here we will spin through all of the "after" hooks on this validator and
     // fire them off. This gives the callbacks a chance to perform all kinds
     // of other validation that needs to get wrapped up in this operation.
     foreach ($this->after as $after) {
         call_user_func($after);
     }
     return count($this->messages->all()) === 0;
 }