Package Data | |
---|---|
Maintainer Username: | danrovito |
Maintainer Contact: | hello@danrovito.com (Dan Rovito) |
Package Create Date: | 2015-09-08 |
Package Last Update: | 2017-09-26 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-08 03:08:41 |
Package Statistics | |
---|---|
Total Downloads: | 132 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 8 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Laravel Gravatar is a simple Laravel package that displays a registered users Gravatar based on their email address in your users table. If the user does not have a registered gravatar it will show the default mystery man.
Via Composer
composer require danrovito/laravel-gravatar
Use Gravatar in your User model.
<?php
namespace App;
use Darovi\Gravatar;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
use Gravatar;
// ...
}
You can also control what attribute should be treated as the email address (instead of email
) by overriding the emailAttributeName()
method:
<?php
namespace App;
use Darovi\Gravatar;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
use Gravatar;
protected function emailAttributeName()
{
return 'your_email_column';
}
// ...
}
Then in your view wherever you want to use the Gravatar
<img src="{{ Auth::user()->gravatar }}">
Laravel Slack Invite is open-sourced software licensed under the MIT license
Please add as many details as possible regarding submission of issues and feature requests
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.