public function validateOrFail()
    {
        // Validate data
        $passed = $this->validate();

        // If validation failed,
        // we'll throw an exception
        if (! $passed) {
            throw new ValidationException($this->validator, $this->getErrorCodes());
        }

        return true;
    }
public function validateOrFail()
    {
        // Validate data
        $passed = $this->validate();

        // If validation failed,
        // we'll throw an exception
        if (! $passed) {
            throw new ValidationException($this->validator, $this->getErrorCodes());
        }

        return true;
    }
public function validateOrFail ( ) { // Validate data $ passed = $ this -> validate ( ) ; // If validation failed, // we'll throw an exception if ( ! $ passed ) { throw new ValidationException ( $ this -> validator , $ this -> getErrorCodes ( ) ) ; } return true ; }
Validate data and throw an exception on failure.

@author Morten Rugaard <moru@nodes.dk>

@return bool
@throws \Nodes\Validation\Exceptions\ValidationException
Validate data and throw an exception on failure .