- How do I install hnhdigital-os/laravel-number-converter in Laravel?
- Install it with Composer using composer require hnhdigital-os/laravel-number-converter. Laravel package auto-discovery should register the service provider, and a facade alias is likely available for convenience. Release 1.7.0 permits Laravel 11 and 12 via widened framework constraints.
- Does laravel-number-converter support Laravel 11 and Laravel 12?
- Release 1.7.0 widens the framework constraints to allow Laravel 11 and Laravel 12. The evaluation treats this as declared support rather than demonstrated support, because the changelog wording does not prove both majors are exercised in CI. Inspect the package CI matrix before relying on it in a critical Laravel 12 deployment.
- How do I convert a number to words using the Laravel Number Converter facade?
- After installation, call the package facade from your formatting layer to convert a number to words. The package is intentionally a thin, stateless utility, so it does not require migrations, queues, or domain wiring. For invoices or contracts, wrap the facade call in an application-owned service so the implementation can be replaced later.
- Can it convert numbers to Roman numerals and ordinal suffixes?
- Yes. The package stated purpose includes converting a numeric number to words, a Roman numeral, and an ordinal suffix. These conversions are exposed through the Laravel facade and service-provider integration. Verify exact method names and edge-case behavior in the README or source before coding against them.
- Is there a config file to publish for locale and currency defaults?
- The provided evaluation does not confirm a publishable config file; it explicitly flags locale, currency, and format defaults as something to verify. Check the package source and README for a config publish command or configurable formatter binding. If no configuration surface exists, treat those defaults as hard-coded or facade-driven and test accordingly.
- Is laravel-number-converter suitable for invoices, cheques, and legal documents?
- The package is aimed at readable output for invoices, cheques, and legal-style documents, supporting localization and currency-style formatting. It is a formatting utility, not a legal certification or compliance tool. For financially or legally meaningful text, call it behind an application-owned seam and add tests for the exact wording your documents require.
- What are the risks of using this number-to-words package in production?
- The main production risk is maintenance: the package is single-maintainer and low-cadence, so abandonment is possible. Output correctness is the second risk because number-to-words behavior is sensitive to zero and negative handling, decimals, currency subunits, pluralization, large magnitudes, and locale rules. If formatting delegates to intl or NumberFormatter, results can vary with the ICU version in your base image. Constraint-widening minor releases also mean Composer lockfiles and CI should control which Laravel major you resolve.
- Does it support localization and currency-style formatting?
- Yes, the package advertises localization and currency-style formatting for readable number output. However, the evaluation does not enumerate supported locales or currencies, nor confirm test coverage for each. Confirm the locale and currency matrix and whether formatting uses intl or NumberFormatter, since ICU version differences can change output between environments.
- How should I test number-to-words and currency output in my Laravel app?
- Add application tests for zero, negative numbers, decimal rounding, currency subunit naming, pluralization, very large magnitudes, and every locale you ship. If the package delegates to intl or NumberFormatter, pin or standardize the ICU version in your base images so test and production output match. Keep these assertions around an application-owned formatter seam so you can swap implementations without rewriting callers.
- What should I check before upgrading from 1.6.0 to 1.7.0?
- Release 1.7.0 is described as a compatibility-only change that widens constraints for Laravel 11 and 12, with no new API, behavior change, or deprecation. Run composer update in a branch, review the lockfile diff, and confirm the resolved Laravel version is the one you intend. Inspect CI for actual Laravel 11 and 12 coverage, because permission in composer.json is not the same as demonstrated support.