owenvoke/mnemonics-php
A lightweight PHP library for generating mnemonics, helping you turn data into memorable, human-friendly phrases. Simple API, framework-agnostic, and easy to drop into any PHP or Laravel project.
BitArray::next(): void, removed unused Mnemonic::ENTROPY_BITS), not new capability. Honest framing: it is a reference implementation and decision accelerant, not a strategic dependency. A 1–2 day in-house build is a credible alternative and this package is a fair benchmark for that estimate.Consider it when:
Look elsewhere when:
dev-main is not a strategy.To executives (one paragraph): We have a recurring product question — should the codes and recovery strings we give users be something a human can actually read, write down, and say out loud? Today we ship opaque strings, users lose them, and support absorbs the cost. There is a small open-source PHP library that generates word-based phrases, and it lets us answer that question in about a week with something real to put in front of users, instead of a six-week build. It is free (MIT), it is not a platform commitment, and it does not touch pricing or our customer-facing roadmap at scale. The one caveat: it requires PHP 8.3, which is an upgrade we should be doing anyway — the library is the trigger, not the reason. Recommendation: approve a one-sprint spike, scoped to invite codes and demo data only, with a written decision at the end on whether human-readable secrets become a real product surface.
To engineering (the terms of the deal): We are adopting this as a reference implementation, not a dependency. Containment is the whole strategy:
uses \Owenvoke\Mnemonic directly.Mnemonic, no referencing the removed Mnemonic::ENTROPY_BITS, no type-hinting BitArray. v3 changed type hints across all classes and altered a method signature for language-version reasons, not defect reasons — that pattern predicts recurring churn with no corresponding benefit. If you need a bit of the package's behavior, copy the logic into the adapter.src/Mnemonic.php: does it accept entropy as an argument, or call random_bytes() internally? If you can pass entropy in, do it — the package degrades to a pure encoder, the safest possible outcome. If it generates internally, read the RNG call before this touches anything user-visible. Also count the words in the bundled list (2048 = 11 bits/word = BIP-39 English) and record the list's provenance and license — if you can't name the list in a security review, you don't have a security review.^3.0, verify actual VCS tags (don't trust registry dates), commit the lockfile, and note the PHP floor in the PR description. Vendor at a pinned tag if phrase generation lands on any critical path.dd() in tinker, Log::info() debugging, Telescope, and exception context all capture payloads and will deposit it in storage/logs/laravel.log and the error tracker. Re-read config/logging.php before shipping.composer update.How can I help you explore Laravel packages today?