Stevemo\Cpanel\Services\Validation\AbstractValidator::passes PHP Method

passes() public method

Test if validation passes
Author: Steve Montambeault
public passes ( ) : boolean
return boolean
    public function passes()
    {
        $validator = $this->validator->make($this->data, $this->rules, $this->messages);
        if ($validator->fails()) {
            $this->errors = $validator->messages();
            return false;
        }
        return true;
    }

Usage Example

Beispiel #1
0
 /**
  * Test if validation passes before update
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @return bool
  */
 public function validForUpdate()
 {
     if (empty($this->data['password']) and empty($this->data['password_confirmation'])) {
         unset($this->rules['password']);
         unset($this->data['password']);
     }
     return parent::passes();
 }
All Usage Examples Of Stevemo\Cpanel\Services\Validation\AbstractValidator::passes