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

Enforce Per-Action Waiting Periods in Laravel with Cooldown image

Enforce Per-Action Waiting Periods in Laravel with Cooldown

Read article
Laravel WhatsApp: Two Backends Behind One Facade image

Laravel WhatsApp: Two Backends Behind One Facade

Read article
Blaze: An Optimized Blade Template Compiler for Laravel image

Blaze: An Optimized Blade Template Compiler for Laravel

Read article
Radiance: Generate Deterministic Mesh Gradient Avatars in PHP image

Radiance: Generate Deterministic Mesh Gradient Avatars in PHP

Read article
Seamless PropelAuth Integration in Laravel with Earhart image

Seamless PropelAuth Integration in Laravel with Earhart

Read article
Simple Media Management with the Artifact Package for Laravel image

Simple Media Management with the Artifact Package for Laravel

Read article
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Shift logo

Shift

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

Shift
Celebian logo

Celebian

Celebian is a social media marketing agency specializing in helping their clients go viral on TikTok. Whether you're looking to reach a bigger audience or gain more Tiktok followers, likes, and views, they've got you covered.

Celebian
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
PhpStorm logo

PhpStorm

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

PhpStorm
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud