From 9f3589836f7c794b55344b87dde7e8a5d0a68779 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Thu, 4 Dec 2014 15:36:19 +0000 Subject: [PATCH] Use users gravatar --- app/models/User.php | 3 +++ app/views/layout/dashboard.blade.php | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/models/User.php b/app/models/User.php index 8bf054da..3974f15c 100644 --- a/app/models/User.php +++ b/app/models/User.php @@ -33,5 +33,8 @@ class User extends Eloquent implements UserInterface, RemindableInterface { $this->attributes['password'] = Hash::make($password); } + public function getGravatarAttribute($size = 200) { + return 'https://www.gravatar.com/avatar/' . md5($this->email) . '?size=' . $size; + } } diff --git a/app/views/layout/dashboard.blade.php b/app/views/layout/dashboard.blade.php index 3b5a110c..b43facd9 100644 --- a/app/views/layout/dashboard.blade.php +++ b/app/views/layout/dashboard.blade.php @@ -9,7 +9,7 @@ {{ isset($pageTitle) ? $pageTitle : Setting::get('app_name') }} | Cachet - + @@ -37,12 +37,12 @@
-
{{Auth::user()->username }}
-
+
{{ Auth::user()->username }}
+