Beispiel #1
0
 /**
  * Determine if the user provides valid values for all fields.
  *
  * @return  boolean
  */
 public function validate()
 {
     $rules = $this->rules();
     $values = $this->data;
     $validator = new Validator($values, $rules);
     if ($validator->fails()) {
         $this->messages->merge($validator->errors());
         return false;
     }
     return true;
 }
Beispiel #2
0
 /**
  * Merge the message collection with another instance.
  *
  * @param   Messages  $messages  Collection to merge with.
  * @return  self
  */
 public function merge(Messages $messages)
 {
     return $this->add($messages->all());
 }