public function getAttribute(string $attribute): array
    {
        // Determine if the attribute is present
        if (! array_key_exists($attribute, $this->attributes)) {
            return [];
        }

        // Return the value of the attribute
        return $this->attributes[$attribute];
    }
public function getAttribute(string $attribute): array
    {
        // Determine if the attribute is present
        if (! array_key_exists($attribute, $this->attributes)) {
            return [];
        }

        // Return the value of the attribute
        return $this->attributes[$attribute];
    }
public function getAttribute ( string $ attribute ) : array { // Determine if the attribute is present if ( ! array_key_exists ( $ attribute , $ this -> attributes ) ) { return [ ] ; } // Return the value of the attribute return $ this -> attributes [ $ attribute ] ; }
Returns the value of the attribute. If the value isn't set, it returns the fallback;
@param string $attribute
@return array
Returns the value of the attribute . If the value isn t set it returns the fallback ;