Kodeine\Metable\Metable::getAttribute PHP Method

getAttribute() public method

Get an attribute from the model.
public getAttribute ( string $key ) : mixed
$key string
return mixed
    public function getAttribute($key)
    {
        // parent call first.
        if (($attr = parent::getAttribute($key)) !== null) {
            return $attr;
        }
        // there was no attribute on the model
        // retrieve the data from meta relationship
        return $this->getMeta($key);
    }