From 8f56f1cfc30f1bf7fe3bd110cd32ad03b6e2de4d Mon Sep 17 00:00:00 2001 From: Achyut Neupane <30431426+achyutkneupane@users.noreply.github.com> Date: Mon, 21 Apr 2025 22:20:06 +0545 Subject: [PATCH 1/2] Added documentation for `spellOrdinal` in Number Facade --- helpers.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/helpers.md b/helpers.md index 3afff368b8..93c4ed745d 100644 --- a/helpers.md +++ b/helpers.md @@ -108,6 +108,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct [Number::pairs](#method-number-pairs) [Number::percentage](#method-number-percentage) [Number::spell](#method-number-spell) +[Number::spellOrdinal](#method-number-spell-ordinal) [Number::trim](#method-number-trim) [Number::useLocale](#method-number-use-locale) [Number::withLocale](#method-number-with-locale) @@ -1649,6 +1650,27 @@ $number = Number::spell(10, until: 10); // 10 ``` + +#### `Number::spellOrdinal()` {.collection-method} + +The `Number::spellOrdinal` method returns the number's ordinal representation in string of words: + +```php +use Illuminate\Support\Number; + +$number = Number::spellOrdinal(1); + +// first + +$number = Number::spellOrdinal(2); + +// second + +$number = Number::spellOrdinal(21); + +// twenty-first +``` + #### `Number::trim()` {.collection-method} From f68c3f92d4ce518ca7c8122d960cebec8ef17f64 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 21 Apr 2025 11:39:31 -0500 Subject: [PATCH 2/2] Update helpers.md --- helpers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers.md b/helpers.md index 93c4ed745d..21efe7c662 100644 --- a/helpers.md +++ b/helpers.md @@ -1653,7 +1653,7 @@ $number = Number::spell(10, until: 10); #### `Number::spellOrdinal()` {.collection-method} -The `Number::spellOrdinal` method returns the number's ordinal representation in string of words: +The `Number::spellOrdinal` method returns the number's ordinal representation as a string of words: ```php use Illuminate\Support\Number;