public function hasError($field=null){
        if($field == null){
            return count($this->errors) > 0;
        }
        return array_key_exists($field, $this->errors);
    }
public function hasError($field=null){
        if($field == null){
            return count($this->errors) > 0;
        }
        return array_key_exists($field, $this->errors);
    }
public function hasError ( $ field = null ) { if ( $ field == null ) { return count ( $ this -> errors ) > 0 ; } return array_key_exists ( $ field , $ this -> errors ) ; }
Return all validation error
@param null $field
@return bool
Return all validation error