From 20a4e4d77d6e882f62ef4c2be3586dbf413641fe Mon Sep 17 00:00:00 2001 From: rmunate Date: Mon, 20 Nov 2023 09:56:53 -0500 Subject: [PATCH] Adjust Output --- README.md | 3 ++- docs/getting-started/changelog.md | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 272dc14..cff59ba 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Introduction -Easily convert numbers to words in Laravel using this library, which leverages the native `PHP INTL` extension to perform conversion effortlessly. With this library, you can convert numbers to words in various languages and also obtain the value in currency format according to the selected language. Supported languages include English, Spanish, Portuguese, French, Italian, Romanian, Hindi, Polish and Persian (Farsi). +Easily convert numbers to words in Laravel using this library, which leverages the native `PHP INTL` extension to perform conversion effortlessly. With this library, you can convert numbers to words in various languages and also obtain the value in currency format according to the selected language. Supported languages include English, Spanish, Portuguese, French, Italian, Romanian, Hindi, Polish, Vietnamese and Persian (Farsi). **This library is compatible with PHP +8.0 and Laravel versions 8.0 and higher** @@ -49,6 +49,7 @@ To whom we thank for supporting making programming easier. - [Gabriel Rausch](https://github.com/gdsrmygdsrjr) (Zero Decimal Correction) - [Alejandro Diaz](https://github.com/alejandrodiazpinilla) (Readme And Icon) - [Frank Sepulveda](https://github.com/socieboy) (Ordinal Texts) +- [Ngô Quốc Đạt](https://github.com/datlechin) (Vietnamese Language) ## License This project is under the [MIT License](https://choosealicense.com/licenses/mit/). diff --git a/docs/getting-started/changelog.md b/docs/getting-started/changelog.md index e73aced..9bbe15b 100644 --- a/docs/getting-started/changelog.md +++ b/docs/getting-started/changelog.md @@ -14,4 +14,24 @@ outline: deep ### Changed -- **TitleCase to LowerCase**: In response to specific language nuances, output is now in lowercase. Developers have the option to modify the output as needed, keeping in mind the use of the callback function. \ No newline at end of file +- **TitleCase to LowerCase**: In response to specific language nuances, output is now in lowercase. Developers have the option to modify the output as needed, keeping in mind the use of the callback function. + +To swiftly revert to title-formatted output, simply publish the configuration file: + +```bash +php artisan vendor:publish --provider="Rmunate\\Utilities\\Providers\\SpellNumberProvider" --tag="config" +``` + +Then, locate the callback function and adjust the return statement in the configuration file: + +```php +return [ + //... + 'callback_output' => function ($data) { + + // Your logic here... + + return \Illuminate\Support\Str::title($data->getWords()); + }, +] +``` \ No newline at end of file