1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27:
<?php namespace JohnRivs\Wunderlist;
trait Avatar {
/**
* Show the avatar URL of a given user.
*
* @param array $attributes
* @return string
*/
public function getAvatar(array $attributes = [])
{
if ( ! isset($attributes['user_id'])) {
$attributes['user_id'] = $this->getCurrentUser()['id'];
}
$this->requires(['user_id'], $attributes);
return $this->http->get("{$this->baseUrl}avatar", [
'headers' => $this->getHeaders(),
'query' => $attributes,
'verify' => false
])->getEffectiveUrl();
}
}