- How do I install riskihajar/terbilang in a Laravel app?
- Install it with Composer using composer require riskihajar/terbilang. Laravel package auto-discovery registers the service provider and facade, so no manual wiring is needed in modern Laravel versions. Optionally publish the config and translation files with php artisan vendor:publish to customize behavior and wording.
- Which languages does this number-to-words package support?
- The package is best known for Indonesian terbilang conversion but is built as a multi-language number-to-words utility. The 2.1.1 test suite covers the en, id, and pt locales, and translations are file-driven so additional locales can be added or overridden. Check the lang directory in the repository for the exact locale set shipped with your version.
- How do I output an amount in words on an invoice or receipt?
- Use the facade or helper at the rendering boundary, for example Terbilang::make(1500000) or the terbilang() helper, and echo the result in your Blade template or PDF document builder. Indonesian invoices and receipts conventionally require the amount spelled out, which is the package's primary use case. Keep the call in views, API resources, or document templates rather than in domain models.
- Why does Roman numeral conversion throw an InvalidNumber exception in 2.1.1?
- In 2.1.1, Roman numeral conversion now throws InvalidNumber for values outside the 1 to 3999 range, replacing the previous behavior of returning an empty string. Any caller that relied on falsy or empty-string handling for out-of-range input will now hit an uncaught exception, which can surface as a 500 in report or document-generation paths. Grep your codebase for Roman or roman call sites and wrap them in try/catch or pre-validate the input range before upgrading.
- How do I migrate the renamed terbilang config key from period.show to distance.show?
- The period.show configuration keys were renamed to distance.show in 2.1.1. Config files published in existing apps retain the old key, so republish the config and diff it, then run config:clear or config:cache as appropriate for your environment. Audit any direct config('terbilang.period.show...') references in your code, since whether a stale key fails silently or loudly depends on the access path.
- Is upgrading from 2.1.0 to 2.1.1 safe, or is it a breaking change?
- 2.1.1 is nominally a patch release with no new public API, no new locales, and no announced deprecations, so the integration blast radius is small. However, two fixes are behavior-changing: the Roman numeral exception and the config key rename, and both can affect consumers even though they shipped in a patch version. Treat those as breaking in your upgrade review by republishing config, clearing caches, and rebaselining snapshot tests for edge-case outputs.
- Does this package require a database, queue, or external service?
- No. It is a leaf presentation-layer utility with no database, queue, cache, or network surface, driven entirely by configuration and translation files. That makes it well suited to rendering boundaries such as Blade views, API resources, notification templates, and PDF generation. It should not appear in domain models or persistence paths.
- How do I override or customize the terbilang translations and configuration?
- Publish the config and language files with php artisan vendor:publish, then edit the published copies rather than vendor files. If you override Portuguese strings, note that 2.1.1 corrected the short translation key to large-number, so update any direct overrides accordingly. Clear the config cache after changes so the new values take effect.
- What Laravel and PHP versions are supported?
- The package is a standard Composer Laravel package, and the 2.1.1 release notes do not announce a minimum-version bump versus 2.1.0. Check composer.json and the README for the exact Laravel and PHP constraints for the release you plan to install. Verify the constraints against your application's matrix before adding the upgrade to CI.
- Is riskihajar/terbilang well tested and actively maintained?
- The 2.1.1 release expanded the test suite from 34 to 271 tests, adding coverage for DistanceDate and full en, id, and pt locale behavior, which is a material maturity improvement. Confirm the suite is wired into CI with a coverage gate to know whether that quality step is durable or one-off. Review the repository's release history and open issues for ongoing maintenance signals.