code: public function getAttribute($strName, $varDefault = false)
      {
          if (isset($this->attributes()->$strName) && (((string)$this->attributes()->$strName) !== '')) {
              return (string)$this->attributes()->$strName;
          } else {
              return $varDefault;
          }
      }
docs: Get an attribute by name
  
  @param string $strName
  @param bool $varDefault
  @return bool|string