pixelpeter/laravel-genderize-api-client
A Laravel client for the Genderize.io API that predicts gender from first names. Clean, framework-friendly integration with simple configuration, making it easy to enrich user profiles or forms with name-based gender detection in any Laravel application.
^12.61.1|^13.0, so older Laravel 12 patch releases are excluded for security reasons. If you are on Laravel 10/11 or PHP 8.1/8.2, stay on v12.0.0—but treat that as frozen and deprecated.^13.0. The package major now tracks the highest supported Laravel major, so ^13.0 is correct for both Laravel 12.x and 13.x applications. Do not assume you need a ^12.x constraint just because your app is on Laravel 12.Genderize (previously the package incorrectly registered Woocommerce). Start with the README, then inspect the published config/genderize.php for endpoint, timeout, API key, and locale/country options. If you previously added a manual alias for Woocommerce, remove it.gender, probability, and count—into your domain. Guard for gender === null or low count/probability; treat those as “unknown” rather than guessing.php artisan package:discover and php artisan optimize:clear will refresh the cached manifest so the Genderize alias is picked up.Genderize:: calls inside a small GenderResolver/action class rather than sprinkling them through controllers and models. This gives you one place to add caching, retries, and fallbacks, and makes it trivial to swap in a fake for tests.genderize:{lowercased-name}:{country}:{language} with a long TTL, and store the raw probability/count alongside the result.RateLimiter::for('genderize', ...) in front of the API call. Avoid synchronous calls inside loops, model accessors, or Blade templates.gender, probability, count, the locale parameters you sent, and a timestamp. This lets you audit decisions and re-evaluate low-confidence results later without re-calling the API.count: 0 response break a registration or checkout flow.Http::fake(). Assert your mapping of the genderize.io JSON payload, including the null-gender and low-probability branches. If you inject your own resolver interface, bind a fake implementation in tests instead of hitting the facade.Woocommerce → Genderize. If your app manually registered the old alias because discovery was broken, delete that registration. If any code still references Woocommerce:: for gender lookups, it will break—and worse, it may have been colliding with a real WooCommerce package alias.bootstrap/cache/packages.php or services.php can leave the old alias in place. Run php artisan package:discover and php artisan optimize:clear.count is common for non-Western names. A result with count: 1 or probability: 0.52 is not a reliable signal. Set a threshold in your resolver and route everything below it to manual review or “unknown”.^12.5.8 with the 12.5 schema, and PHPStan runs on PHP 8.3. If you fork the package or run its test suite in CI, update phpunit.xml and your CI matrix accordingly; this does not affect normal application usage.^13.0 supports both Laravel 12 and 13, a future Laravel 14 release will presumably become ^14.0 and drop Laravel 12. Pin the package major deliberately and watch the release notes rather than assuming the package major matches your app’s Laravel major.How can I help you explore Laravel packages today?