src/Validation/ValidationResult.php
public function error()
    {
        $errors = $this->validator->errors();

        $this->error = empty($errors) ?: array_pop($errors)[0];

        return $this->error;
    }
public function error()
    {
        $errors = $this->validator->errors();

        $this->error = empty($errors) ?: array_pop($errors)[0];

        return $this->error;
    }
public function error ( ) { $ errors = $ this -> validator -> errors ( ) ; $ this -> error = empty ( $ errors ) ? : array_pop ( $ errors ) [ 0 ] ; return $ this -> error ; }
Get first validation error if exists.

@return string
Get first validation error if exists .