ホーム画面のレイアウト変更

This commit is contained in:
shibafu
2017-10-23 00:03:24 +09:00
parent 70ae2fd982
commit b5f04cb153
3 changed files with 72 additions and 75 deletions

View File

@@ -29,4 +29,14 @@ class User extends Authenticatable
protected $hidden = [
'password', 'remember_token',
];
/**
* このユーザのメールアドレスから、Gravatarの画像URLを生成します。
* @param int $size 画像サイズ
* @return string Gravatar 画像URL
*/
public function getProfileImageUrl($size = 30) : string {
$hash = md5(strtolower(trim($this->email)));
return '//www.gravatar.com/avatar/' . $hash . '?s=' . $size;
}
}