tomshaw/laravel-gravatar
Zero-config Laravel Blade @gravatar directive that generates Gravatar image URLs using named parameters. Pass email, size, default style, and rating to quickly render user avatars with sensible defaults and no setup.
@gravatar directives).users table).+ suffixes or subdomains may break hashing).users.email column) Gravatar requires valid email hashes.resources/views/user/profile.blade.php) with @gravatar directives.size, rating, and default options.secure: true (HTTPS), but can be disabled.composer require tomshaw/laravel-gravatar.@gravatar directives.
Example:
<!-- Before -->
<img src="https://www.gravatar.com/avatar/{{ md5(user->email) }}?s=50&d=mp">
<!-- After -->
<img src="@gravatar(email: user->email, size: 50, default: 'mp')">
null emails, invalid formats).mp placeholder if no avatar exists (reduces support tickets).retro, identicon); no per-user tweaks.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Gravatar CDN downtime | Avatars broken until CDN recovers | Use fallback defaults (e.g., default: 'robohash') |
| Invalid user emails | Broken image tags | Validate emails before rendering |
| Laravel/Blade rendering errors | Directive fails silently | Add @error handling in Blade templates |
| Package compatibility issues | Breaks on Laravel upgrades | Test in staging before production rollout |
| High traffic to Gravatar | Rate limiting or throttling | Implement local caching or queue requests |
How can I help you explore Laravel packages today?