Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Facehash Laravel Package

saade/facehash

Generate deterministic SVG avatar faces from any string in Laravel. Pure PHP output, no GD, Imagick, or external services needed. Consistent, unique avatars with sizes, shapes, colors, and variants.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • User Profile Avatars: Generate deterministic avatars from email, username, or ID. v1.3.0 fixes non-ASCII hashing so names like “Zoë” and “日本語” now match the upstream JavaScript output—important for international products and consistent global identity.
  • Data Privacy Compliance: The HTTP avatar route no longer sets session or XSRF cookies by default (route.middleware now []), removing an avoidable tracking/cookie-consent concern for publicly cacheable avatar endpoints.
  • Performance and Caching: The route is now better suited to CDN/public caching because it no longer attaches web middleware cookies. This lowers per-request overhead and improves cache hit behavior at scale.
  • Internationalization Readiness: UTF-16 code-unit hashing aligns PHP-generated avatars with the original facehash library, reducing visual drift across services and client/server rendering paths.
  • Brand Consistency and Customization: colors([]) now safely falls back to configured or shipped palettes instead of crashing. FaceSvgData::get() exposes an eyes key, enabling more targeted theming or accessibility work.
  • Roadmap Trade-offs: v1.3.0 adds a Pest test suite, CI across PHP 8.2–8.5 and Laravel 11–13, plus a docs site and playground. This materially reduces “build vs. buy” maintenance risk versus maintaining a custom deterministic avatar implementation.
  • Launch and Upgrade Planning: Teams already serving the HTTP route must plan for non-ASCII avatar changes and clear or version one-year immutable caches; published config/facehash.php files need the middleware default updated to avoid unwanted cookies.

When to Consider This Package

  • Avoid if:
    • High Customization Needs: Requires animated, expression-based, or non-deterministic avatars beyond hashing and SVG composition.
    • Existing Infrastructure: Already has a low-friction, scalable avatar pipeline (e.g., Cloudinary, S3-backed uploads) and no privacy or cost pressure to change.
    • Non-Text Inputs: Primary use case is video, audio, or biometric-derived avatars rather than string-seeded identities.
    • Limited Laravel/PHP Capacity: The team cannot own package integration, config publishing, and cache invalidation around avatar changes.
  • Consider if:
    • You need deterministic, zero-external-dependency avatars for large user bases with low latency.
    • You serve international users and need non-ASCII names to produce the same avatar as the upstream facehash implementation.
    • You prioritize privacy, cookie-free caching, offline support, or cost efficiency over third-party avatar services.
    • You can handle the v1.3.0 upgrade notes: non-ASCII avatars change, published config middleware should move from ['web'] to [], and blink() eye classes may differ.
    • You are willing to extend the package via Laravel service providers for palettes, shapes, or theming.

How to Pitch It (Stakeholders)

For Executives: “This package generates consistent, privacy-friendly user avatars instantly—without external APIs, uploaded files, or cookie-setting routes. The new release fixes international names, so ‘Zoë’ or ‘日本語’ now render the same avatar as our JavaScript tooling, and the avatar route is safer to cache publicly. It now has automated tests across supported PHP/Laravel versions and public docs, reducing maintenance risk. Upfront cost is near zero, and it scales without new infrastructure. The main upgrade caveat is that non-ASCII avatars will change, so we should version or purge cached images during rollout.”

For Engineering: *“Facehash v1.3.0 is a meaningful reliability and privacy update:

  • International parity: hashing now reads UTF-16 code units like the JavaScript library, so non-ASCII names match upstream. ASCII names are unaffected.
  • Cookie-free HTTP route: route.middleware defaults to []; if you published config/facehash.php, update your copy from ['web'] to [] unless you intentionally rely on sessions there.
  • Stability fixes: colors([]) falls back safely; blink eyes animate together; FaceSvgData::get() now exposes an eyes key.
  • Maintenance signal: Pest suite in CI on PHP 8.2–8.5 and Laravel 11–13, plus docs/playground at facehash.saade.dev.
  • Upgrade risk: non-ASCII avatars change, so one-year immutable caches may serve stale images until expiry—plan cache busting or versioned URLs. Markup without blink() is byte-for-byte unchanged; with blink(), eye classes changed on some faces. Recommend spiking profile pages and notification avatars, then validating cache invalidation and i18n behavior before rollout.”*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table