mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Added user avatars. Fixes #20
This commit is contained in:
12
app/User.php
12
app/User.php
@ -32,4 +32,16 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = ['password', 'remember_token'];
|
||||
|
||||
/**
|
||||
* Returns the user's avatar,
|
||||
* Uses Gravatar as the avatar service.
|
||||
* @param int $size
|
||||
* @return string
|
||||
*/
|
||||
public function getAvatar($size = 50)
|
||||
{
|
||||
$emailHash = md5(strtolower(trim($this->email)));
|
||||
return '//www.gravatar.com/avatar/' . $emailHash . '?s=' . $size . '&d=identicon';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user