Gravatar

creativeorange/gravatar image

Gravatar stats

Downloads
4.8M
Stars
518
Open Issues
4
Forks
58

View on GitHub →

A Laravel Gravatar package for retrieving gravatar image URLs or checking the existance of an image.

Gravatar for Laravel 5 - 10

The creativeorange/gravatar package is a convenient Laravel integration for working with Gravatar - a service that provides globally recognized avatars. Designed to be compatible with Laravel versions 5 through 10, this package simplifies the process of fetching Gravatar images associated with email addresses.

Key Features

  • Fetch Gravatar Images: Easily retrieve the URL to the Gravatar image for any email.
  • Default Image Fallbacks: Specify a default image in cases where no Gravatar exists for the given email.
  • Check Existence: Verify the presence of a Gravatar for a particular email.
  • Customizable: Modify Gravatar size, fallback image, security settings, and more through configuration.
  • Multiple Configuration Profiles: Supports multiple preset configurations for different use cases.

Installation

  1. Via Composer:

    composer require creativeorange/gravatar ~1.0
  2. Service Provider:

    • For Laravel 5.3 and below, add to app/config/app.php:
      'providers' => [
      'Creativeorange\Gravatar\GravatarServiceProvider'
      ];
    • For Laravel 5.4 and above, use config/app.php:
      'providers' => [
      Creativeorange\Gravatar\GravatarServiceProvider::class
      ];
  3. Facade Alias (Optional):

    • For Laravel 5.3 and below:
      'aliases' => [
      'Gravatar' => 'Creativeorange\Gravatar\Facades\Gravatar',
      ];
    • For Laravel 5.4 and above:
      'aliases' => [
      'Gravatar' => Creativeorange\Gravatar\Facades\Gravatar::class,
      ];
  4. Publish Configuration:

    php artisan vendor:publish

Usage

  • Retrieve a Gravatar URL:

    Gravatar::get('email@example.com');
  • Check for Gravatar Existence:

    Gravatar::exists('email@example.com');
  • Use a Custom Fallback Image:

    Gravatar::fallback('http://urlto.example.com/avatar.jpg')->get('email@example.com');
  • Specify Configuration on-the-fly:

    Gravatar::get('email@example.com', 'small-secure');
    Gravatar::get('email@example.com', ['size'=>200]);

This package offers a streamlined way to integrate Gravatar functionality into your Laravel applications, enhancing your user profiles with globally recognized avatars. Configurable and easy to use, it fits well within the Laravel ecosystem.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Creativeorange Gravatar Related Articles

Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Honeybadger logo

Honeybadger

Simple developer-focused application monitoring for Laravel. Error tracking, log management, uptime monitoring, status pages, and more!

Honeybadger
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit