nicobleiler/php-passphrase
Generate secure, memorable passphrases in PHP with nicobleiler/php-passphrase. Configure word counts, separators, and wordlists to create Diceware-style passwords with strong entropy for user-friendly authentication.
num_words, word_separator, capitalize, include_number, bundled wordlists, and an excluded-words list let the PM shape one policy (e.g. "4 words, hyphen-separated, no numbers") and change it via config rather than a sprint.ConfigException with descriptive validation messages, type validation for word lists and excluded words, and PHPStan level 10 analysis. This is the kind of evidence to cite when a security reviewer asks "is config failure loud or silent?"Str::random/random_bytes. Keep the two decisions separate so this package doesn't get over-scoped.Adopt when:
ConfigException means previously tolerated (mis)configurations — non-integer num_words, non-string word_separator, non-boolean capitalize / include_number, non-string list entries — will now fail loudly. That's the right behavior, but it is a behavioral change that can surface as a boot-time exception in existing apps.Look elsewhere when:
To executives: A small, free dependency that removes bespoke code for the passwords and codes we hand to humans. The new release makes bad configuration fail at startup instead of producing subtly weaker passphrases — a cheap, concrete security win with no product-visible change. Cost is one Composer entry; risk is a low-traffic, single-maintainer package that we should pin.
To engineering: v2.2.0-beta.1 is a hardening release, not a feature release. It introduces ConfigException for config validation (typed checks on num_words, word_separator, capitalize, include_number, word list, and excluded words), raises PHPStan to level 10 with benevolent union checking, adds tests for non-string list elements and invalid config types, improves facade/service-provider docblocks, and adds Testbench 11 support. Practical guidance: audit your config/passphrase.php before upgrading, expect a boot-time throw where config was previously silently coerced, pin the beta tag, and treat the core generator contract as stable while the validation layer settles.
How can I help you explore Laravel packages today?