Download the PHP package nurbekjummayev/laravel-number-words without Composer
On this page you can find all versions of the php package nurbekjummayev/laravel-number-words. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nurbekjummayev/laravel-number-words
More information about nurbekjummayev/laravel-number-words
Files in nurbekjummayev/laravel-number-words
Package laravel-number-words
Short Description Multi-language number and date formatter with easy translation support for Laravel
License MIT
Informations about the package laravel-number-words
Multi-Language Number & Date Formatter for Laravel
A Laravel package for converting numbers to words and formatting dates in multiple languages. The core logic stays in one place, while translations are stored in separate language files. Developers can easily add new languages by simply adding translation files without touching the core code.
Features
- Convert numbers to words in multiple languages
- Format currency with localized text
- Convert numbers to ordinal format (1st, 2nd, 3rd, etc.)
- Format dates with localized month and day names
- Relative time formatting (e.g., "2 hours ago")
- Easy to add new languages - just create translation files
- No code duplication - universal algorithm for all languages
- Laravel-friendly with Facade support and helper functions
Supported Languages
Out of the box:
- Uzbek (Latin) (uz) - O'zbek tili
- Uzbek (Cyrillic) (uz_cyrl) - Ўзбек тили
- English (en)
- Russian (ru) - Русский
Learn how to add more languages →
Installation
Install via Composer:
The package will automatically register its service provider.
Publish Configuration (Optional)
Publish Language Files (Optional)
Configuration
After publishing the config file, you can set your default locale in config/multilang.php:
Or set it in your .env file:
Usage
Number to Words
Using Facade
Using Helper Function
Currency Formatting
Ordinal Numbers
Date Formatting
Available Date Formats
default: Standard format for the localefull: Full format with weekdayshort: Short format (month and day only)long: Long format with year
Relative Time
Adding New Languages
Adding a new language is super easy! You just need to create two translation files:
lang/{locale}/numbers.php- Number translationslang/{locale}/dates.php- Date translations
For detailed instructions, see ADDING_LANGUAGES.md
Quick Example: Adding Turkish
Create lang/tr/numbers.php:
Create lang/tr/dates.php:
That's it! Now you can use it:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Nurbek Jummayev
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Support
If you find this package helpful, please consider giving it a star on GitHub!
All versions of laravel-number-words with dependencies
illuminate/support Version ^11.0|^12.0|^13.0
nesbot/carbon Version ^2.72|^3.0
spatie/laravel-package-tools Version ^1.93