Download the PHP package codemarkt/laravel-number-to-words without Composer
On this page you can find all versions of the php package codemarkt/laravel-number-to-words. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codemarkt/laravel-number-to-words
More information about codemarkt/laravel-number-to-words
Files in codemarkt/laravel-number-to-words
Package laravel-number-to-words
Short Description Multi-language and multi-currency number to words converter for Laravel
License MIT
Informations about the package laravel-number-to-words
Laravel Number to Words
Multi-language and multi-currency number to words converter for Laravel.
Features
- Convert numbers to words in multiple languages (Turkish, English)
- Convert currency amounts to words with proper formatting
- Smart pluralization support (e.g., "1 dollar" vs "2 dollars")
- Flexible input parsing (handles various number formats)
- Customizable output (uppercase, lowercase, custom separators)
- Fail-safe (never throws exceptions)
- Easy to extend with new languages and currencies
Installation
Configuration
Publish the configuration file:
Publish the language files (optional):
Configuration options in config/number-to-words.php:
Usage
Recommended: Using Helper Functions (Shorter Syntax)
Using Facade (Alternative)
Using Service Container
Input Formats
The package handles various number formats automatically:
Supported Languages
- Turkish (tr)
- English (en)
Supported Currencies
- TRY (Turkish Lira)
- USD (US Dollar)
- EUR (Euro)
- GBP (British Pound)
Adding Custom Languages and Currencies
Adding a New Currency
Simply add the currency to your language files. The package supports both simple strings and pluralization:
Simple format (backward compatible):
With pluralization (recommended for proper grammar):
The package automatically uses the correct form based on the amount:
1.50 USD→ "one US dollar fifty cents"2.00 USD→ "two US dollars"
Creating a New Language File
Create a new language file in resources/lang/vendor/number-to-words/{locale}/number.php:
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-number-to-words with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/translation Version ^11.0|^12.0