public function getAttribute($name, $default = null)
    {
        if (in_array($name, $this->emulatedAttributes, true)) {
            return $this->{$name};
        }
        if (array_key_exists($name, $this->attributes)) {
            return $this->attributes[$name];
        }

        return $default;
    }
public function getAttribute($name, $default = null)
    {
        if (in_array($name, $this->emulatedAttributes, true)) {
            return $this->{$name};
        }
        if (array_key_exists($name, $this->attributes)) {
            return $this->attributes[$name];
        }

        return $default;
    }
public function getAttribute ( $ name , $ default = null ) { if ( in_array ( $ name , $ this -> emulatedAttributes , true ) ) { return $ this -> { $ name } ; } if ( array_key_exists ( $ name , $ this -> attributes ) ) { return $ this -> attributes [ $ name ] ; } return $ default ; }
Read an attribute from the request, or get the default

@param string $name The attribute name.
@param mixed|null $default The default value if the attribute has not been set.
@return mixed
Read an attribute from the request or get the default