illuminate/hashing
Laravel's hashing component provides secure password hashing through Bcrypt and Argon2 drivers, a simple Hash facade for make, check, and rehash operations, configurable work factors, and automatic algorithm verification to keep stored credentials safe across your PHP applications.
Architecture fit: illuminate/hashing is a subtree split of the Laravel framework rather than a conventionally versioned standalone library. That matters for a TPM: it means the package's public contract is shaped by Laravel's internal conventions (the Hash facade, Hasher/HasherInterface contracts, HashManager, driver configuration through config/hashing.php). In a Laravel application it is effectively free infrastructure — already installed, already wired into the service container, already exercised by every authentication flow in the ecosystem. Outside Laravel it is usable but awkward: you must bootstrap a container, register the hashing service provider, supply configuration, and pull in transitive illuminate/* dependencies. The architecture is a good fit only where Laravel (or at least the Illuminate component set) is already the substrate.
Integration feasibility: High for Laravel projects — composer require illuminate/hashing is a no-op in practice since it ships with the framework, and the API surface is two calls (Hash::make, Hash::check) plus Hash::needsRehash for transparent rehashing on login. For non-Laravel stacks, feasibility is moderate: the work is not the hashing (PHP's password_hash/password_verify underpin it) but the container wiring, configuration plumbing, and dependency footprint. The realistic decision is build-vs-buy at the framework level, not at the package level: if you are on Laravel, adopt; if you are not, native password_hash() is a smaller, cleaner answer.
Technical risk: Three risks are worth naming to a steering group. First, coupling to Laravel's release cadence — security fixes arrive on Laravel's schedule and in Laravel's versioning scheme, so this package is not independently patchable. That is usually a benefit (maintained by the core team, broad production exposure) but it removes your ability to pin or accelerate a fix. Second, standalone coverage and support expectations — as a subtree split, the package is tested as part of the framework; treating it as an independently supported library invites a support gap that does not exist in the docs. Third, algorithm/runtime coupling: argon2id requires PHP ≥ 7.3 and sufficient memory; bcrypt cost and Argon memory parameters are a direct, non-linear CPU/RAM tax at authentication time. The package makes this configurable, which means it makes it your capacity decision. The reported Dependents: 0 and the future-dated 2026-10-27 release metadata should be treated as registry/telemetry artifacts, not as evidence of adoption or roadmap — do not cite them in a decision record.
Key questions:
Stack fit: Near-perfect for Laravel applications; it is native to the framework's service container, config system, and auth scaffolding (Hash facade, HasherInterface for injection, driver selection via HASH_DRIVER). For Symfony/Slim/custom PHP it is a poor fit — you would be importing Laravel's container and config layers to hash a string, which is over-engineering when password_hash() with PASSWORD_ARGON2ID or PASSWORD_BCRYPT does the same work with zero dependencies. For non-PHP services (Node, Go, Python) it is simply not applicable, though hash compatibility across services must be confirmed at the bcrypt/Argon2 format level if multiple runtimes touch the same credential store.
Migration path: If already on Laravel, there is no migration — the package is present and likely already used by Auth. The work is an audit, not an install: find any direct password_hash/md5/sha1 calls and replace with Hash::make/Hash::check. If moving from a legacy custom hashing scheme, the pragmatic path is a transitional verifier (check legacy hash, then rehash with Hash::make on successful login via needsRehash) rather than a bulk credential reset, which is a user-experience and support-cost event. This is where a TPM earns their keep: sequencing the cutover so the legacy verifier is retired on a defined date, with instrumentation proving zero legacy verifications before removal.
Compatibility: Aligns with Laravel's supported PHP matrix; PHP ≤ 7.2 is out, and Argon2id specifically needs ≥ 7.3 with the relevant password_algos() support. Driver availability must be verified per environment — a ValueError on an older or misconfigured runtime at login time is an availability incident, not a config nit. bcrypt hashes are portable across environments and runtimes, which makes it the safer default for heterogeneous or containerized fleets; Argon2id is the stronger choice where memory is predictable and provisioned.
Sequencing: (1) Confirm framework baseline and that config/hashing.php is present and explicit rather than relying on inherited defaults. (2) Standardize driver and cost parameters as a documented decision with a capacity rationale. (3) Inventory existing hashing call sites and legacy credential formats. (4) Implement rehash-on-login with metrics on legacy-hash encounters. (5) Load-test authentication under production-representative concurrency to validate cost parameters before any increases. (6) Retire legacy verifiers on a scheduled date with a dashboard proving zero usage. (7) Only then consider parameter hardening as an ongoing, incremental practice.
Maintenance: Effectively outsourced to Laravel's core team — the strongest argument for the package. There is no separate dependency to track, patch, or vendor; security fixes arrive through normal framework upgrades. The counterweight is that you have no independent release lever and no ability to take a fix ahead of Laravel's cadence. Operationally this converts a library-maintenance question into a framework-upgrade-discipline question, which is a healthier place to be but depends entirely on the organization actually staying current.
Support: First-line support questions ("why did login get slower", "why do users need to reset passwords") are answerable from Laravel's documentation and are widely represented in the community, which lowers triage cost. Do not staff or budget for this as a standalone OSS dependency; budget instead for Laravel upgrade work and for the security-advisory intake process that governs it. Expect near-zero vendor-risk discussion and non-trivial internal-governance discussion.
Scaling: Hashing is deliberately expensive, and it sits on the hottest, most latency-sensitive path in the product — login, registration, password reset. Cost parameters are a direct multiplier on CPU (bcrypt) or CPU and memory (Argon2). Scaling implications are concrete: authentication nodes need headroom sized for peak login bursts, autoscaling policies must account for the fact that a login consumes meaningfully more CPU than a typical request, and Argon2id's memory cost can dominate container memory limits and cause OOM kills under concurrency. Treat the cost parameter as a capacity-planning input with an owner, not a config detail. Raising it later is safe if rehash-on-login is in place; raising it without that mechanism is a fleet-wide performance change.
Failure modes:
argon2id on a runtime without support throws at hash time, breaking registration and login simultaneously. Mitigate by validating driver availability at boot or in CI, not at first user request.=== comparison of hashes, or a code path that stores plaintext or reversible encryption for credentials, is a severe defect that the package cannot prevent. Enforce via code review and static analysis.Ramp-up: Very low for any engineer already working in Laravel — the API is two methods and the idioms (make, check, needsRehash, driver config) are standard. The genuine ramp-up cost is not the package, it is the surrounding judgment: understanding why cost parameters matter, why comparison must go through check, how to size capacity for Argon2 memory, and how to structure a legacy-credential migration. That is a short, targeted onboarding rather than a training program. For engineers on non-Laravel stacks, the ramp-up is dominated by adopting Illuminate conventions for a single utility, which is rarely a good trade — the recommendation there is to avoid the dependency and use PHP's native password API.
How can I help you explore Laravel packages today?