Get expert guidance in a few days with a Laravel code review

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

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
MongoDB Document Structure & Data Modeling image

MongoDB Document Structure & Data Modeling

Read article
Meet LaraUtilX: A Utility Toolkit Every Laravel Developer Needs image

Meet LaraUtilX: A Utility Toolkit Every Laravel Developer Needs

Read article
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
CodeKudu logo

CodeKudu

Stand-ups, Retrospectives, and 360° Feedback for the entire team. 50% off with code LARAVELNEWS.

CodeKudu
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
DreamzTech logo

DreamzTech

Hire 6-10+ Yrs. experienced skilled Laravel Developers from DreamzTech. We ensure NDA protected, 100% quality delivery. Contact Us & Discuss Your Need.

DreamzTech
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
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search