Skip to content

Commit c08e8c0

Browse files
committed
Merge branch '10.x'
2 parents 298272b + 1b40cbd commit c08e8c0

File tree

4 files changed

+104
-3
lines changed

4 files changed

+104
-3
lines changed

dusk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
To get started, you should install [Google Chrome](https://www.google.com/chrome) and add the `laravel/dusk` Composer dependency to your project:
6262

6363
```shell
64-
composer require --dev laravel/dusk
64+
composer require laravel/dusk --dev
6565
```
6666

6767
> [!WARNING]

helpers.md

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
9494
[Number::currency](#method-number-currency)
9595
[Number::fileSize](#method-number-file-size)
9696
[Number::forHumans](#method-number-for-humans)
97+
[Number::ordinal](#method-number-ordinal)
98+
[Number::spell](#method-number-spell)
99+
[Number::useLocale](#method-number-use-locale)
100+
[Number::withLocale](#method-number-with-locale)
97101

98102
</div>
99103

@@ -1220,6 +1224,87 @@ The `Number::forHumans` method returns the human-readable format of the provided
12201224

12211225
// 1.23 million
12221226

1227+
<a name="method-number-ordinal"></a>
1228+
#### `Number::ordinal()` {.collection-method}
1229+
1230+
The `Number::ordinal` method returns a number's ordinal representation:
1231+
1232+
use Illuminate\Support\Number;
1233+
1234+
$number = Number::ordinal(1);
1235+
1236+
// 1st
1237+
1238+
$number = Number::ordinal(2);
1239+
1240+
// 2nd
1241+
1242+
$number = Number::ordinal(21);
1243+
1244+
// 21st
1245+
1246+
<a name="method-number-spell"></a>
1247+
#### `Number::spell()` {.collection-method}
1248+
1249+
The `Number::spell` method transforms the given number into a string of words:
1250+
1251+
use Illuminate\Support\Number;
1252+
1253+
$number = Number::spell(102);
1254+
1255+
// one hundred and two
1256+
1257+
$number = Number::spell(88, locale: 'fr');
1258+
1259+
// quatre-vingt-huit
1260+
1261+
1262+
The `after` argument allows you to specify a value after which all numbers should be spelled out:
1263+
1264+
$number = Number::spell(10, after: 10);
1265+
1266+
// 10
1267+
1268+
$number = Number::spell(11, after: 10);
1269+
1270+
// eleven
1271+
1272+
The `until` argument allows you to specify a value before which all numbers should be spelled out:
1273+
1274+
$number = Number::spell(5, until: 10);
1275+
1276+
// five
1277+
1278+
$number = Number::spell(10, until: 10);
1279+
1280+
// 10
1281+
1282+
<a name="method-number-use-locale"></a>
1283+
#### `Number::useLocale()` {.collection-method}
1284+
1285+
The `Number::useLocale` method sets the default number locale globally, which affects how numbers and currency are formatted by subsequent invocations to the `Number` class's methods:
1286+
1287+
use Illuminate\Support\Number;
1288+
1289+
/**
1290+
* Bootstrap any application services.
1291+
*/
1292+
public function boot(): void
1293+
{
1294+
Number::useLocale('de');
1295+
}
1296+
1297+
<a name="method-number-with-locale"></a>
1298+
#### `Number::withLocale()` {.collection-method}
1299+
1300+
The `Number::withLocale` method executes the given closure using the specified locale and then restores the original locale after the callback has executed:
1301+
1302+
use Illuminate\Support\Number;
1303+
1304+
$number = Number::withLocale('de', function () {
1305+
return Number::format(1500);
1306+
});
1307+
12231308
<a name="paths"></a>
12241309
## Paths
12251310

@@ -1996,7 +2081,7 @@ The `value` function returns the value it is given. However, if you pass a closu
19962081
});
19972082

19982083
// false
1999-
2084+
20002085
Additional arguments may be passed to the `value` function. If the first argument is a closure then the additional parameters will be passed to the closure as arguments, otherwise they will be ignored:
20012086

20022087
$result = value(function (string $name) {

strings.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
185185
[squish](#method-fluent-str-squish)
186186
[start](#method-fluent-str-start)
187187
[startsWith](#method-fluent-str-starts-with)
188+
[stripTags](#method-fluent-str-strip-tags)
188189
[studly](#method-fluent-str-studly)
189190
[substr](#method-fluent-str-substr)
190191
[substrReplace](#method-fluent-str-substrreplace)
@@ -2295,6 +2296,21 @@ The `startsWith` method determines if the given string begins with the given val
22952296

22962297
// true
22972298

2299+
<a name="method-fluent-str-strip-tags"></a>
2300+
#### `stripTags` {.collection-method}
2301+
2302+
The `stripTags` method removes all HTML and PHP tags from a string:
2303+
2304+
use Illuminate\Support\Str;
2305+
2306+
$result = Str::of('<a href="https://laravel.com">Taylor <b>Otwell</b></a>')->stripTags();
2307+
2308+
// Taylor Otwell
2309+
2310+
$result = Str::of('<a href="https://laravel.com">Taylor <b>Otwell</b></a>')->stripTags('<b>');
2311+
2312+
// Taylor <b>Otwell</b>
2313+
22982314
<a name="method-fluent-str-studly"></a>
22992315
#### `studly` {.collection-method}
23002316

upgrade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<a name="estimated-upgrade-time-??-minutes"></a>
4141
#### Estimated Upgrade Time: ?? Minutes
4242

43-
> [!NOTE]
43+
> [!NOTE]
4444
> We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application. Want to save time? You can use [Laravel Shift](https://laravelshift.com/) to help automate your application upgrades.
4545
4646
<a name="updating-dependencies"></a>

0 commit comments

Comments
 (0)