Skip to content

Commit

Permalink
Implemented gravarar plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
rappasoft committed Sep 23, 2015
1 parent 6c42712 commit 551fc56
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 9 deletions.
7 changes: 7 additions & 0 deletions app/Models/Access/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,11 @@ public function getConfirmedLabelAttribute() {
return "<label class='label label-success'>Yes</label>";
return "<label class='label label-danger'>No</label>";
}

/**
* @return mixed
*/
public function getPictureAttribute() {
return gravatar()->get($this->email, ['size' => 50]);
}
}
11 changes: 11 additions & 0 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ function javascript()
{
return app('JavaScript');
}
}

if ( ! function_exists('gravatar'))
{
/**
* Access the gravatar helper
*/
function gravatar()
{
return app('gravatar');
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"fortawesome/font-awesome": "4.*",
"hieu-le/active": "~2.0",
"laracasts/utilities": "~2.0",
"arcanedev/log-viewer": "~3.4.0"
"arcanedev/log-viewer": "~3.4.0",
"creativeorange/gravatar": "~1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
Expand Down
48 changes: 46 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,16 @@
'App\Providers\EventServiceProvider',
'App\Providers\RouteServiceProvider',
'App\Providers\MacroServiceProvider',
'Laravel\Socialite\SocialiteServiceProvider',

/*
* Third party service providers
*/
'Arcanedev\LogViewer\LogViewerServiceProvider',
'Creativeorange\Gravatar\GravatarServiceProvider',
'HieuLe\Active\ActiveServiceProvider',
'Laracasts\Utilities\JavaScript\JavascriptServiceProvider',
'Laravel\Socialite\SocialiteServiceProvider',
'Potsky\LaravelLocalizationHelpers\LaravelLocalizationHelpersServiceProviderLaravel5',
'Arcanedev\LogViewer\LogViewerServiceProvider',
],

/*
Expand Down Expand Up @@ -211,9 +216,11 @@
'View' => 'Illuminate\Support\Facades\View',

/* Third Party */
'Active' => 'HieuLe\Active\Facades\Active',
'Form' => 'Illuminate\Html\FormFacade',
'Gravatar' => 'Creativeorange\Gravatar\Facades\Gravatar',
'HTML' => 'Illuminate\Html\HtmlFacade',
'Socialize' => 'Laravel\Socialite\Facades\Socialite',
'Active' => 'HieuLe\Active\Facades\Active',

],
];
Binary file removed public/img/backend/user2-160x160.jpg
Binary file not shown.
4 changes: 2 additions & 2 deletions resources/views/backend/includes/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<!-- The user image in the navbar-->
<img src="{!!asset('img/backend/user2-160x160.jpg')!!}" class="user-image" alt="User Image"/>
<img src="{!! access()->user()->picture !!}" class="user-image" alt="User Image"/>
<!-- hidden-xs hides the username on small devices so only the image appears. -->
<span class="hidden-xs">{{ access()->user()->name }}</span>
</a>
<ul class="dropdown-menu">
<!-- The user image in the menu -->
<li class="user-header">
<img src="{!!asset('img/backend/user2-160x160.jpg')!!}" class="img-circle" alt="User Image" />
<img src="{!! access()->user()->picture !!}" class="img-circle" alt="User Image" />
<p>
{{ access()->user()->name }} - {{ trans('roles.web_developer') }}
<small>{{ trans('strings.member_since') }} XX/XX/XXXX</small>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/backend/includes/sidebar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- Sidebar user panel (optional) -->
<div class="user-panel">
<div class="pull-left image">
<img src="{!!asset('img/backend/user2-160x160.jpg')!!}" class="img-circle" alt="User Image" />
<img src="{!! access()->user()->picture !!}" class="img-circle" alt="User Image" />
</div>
<div class="pull-left info">
<p>{{ access()->user()->name }}</p>
Expand Down

0 comments on commit 551fc56

Please sign in to comment.