You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: strings.md
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
35
35
[preg_replace_array](#method-preg-replace-array)
36
36
[Str::after](#method-str-after)
37
37
[Str::afterLast](#method-str-after-last)
38
+
[Str::apa](#method-str-apa)
38
39
[Str::ascii](#method-str-ascii)
39
40
[Str::before](#method-str-before)
40
41
[Str::beforeLast](#method-str-before-last)
@@ -117,6 +118,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
117
118
118
119
[after](#method-fluent-str-after)
119
120
[afterLast](#method-fluent-str-after-last)
121
+
[apa](#method-fluent-str-apa)
120
122
[append](#method-fluent-str-append)
121
123
[ascii](#method-fluent-str-ascii)
122
124
[basename](#method-fluent-str-basename)
@@ -278,6 +280,17 @@ The `Str::afterLast` method returns everything after the last occurrence of the
278
280
279
281
// 'Controller'
280
282
283
+
<aname="method-str-apa"></a>
284
+
#### `Str::apa()` {.collection-method}
285
+
286
+
The `Str::apa` method converts the given string to title case following the [APA guidelines](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case):
287
+
288
+
use Illuminate\Support\Str;
289
+
290
+
$title = Str::apa('Creating A Project');
291
+
292
+
// 'Creating a Project'
293
+
281
294
<aname="method-str-ascii"></a>
282
295
#### `Str::ascii()` {.collection-method}
283
296
@@ -1314,6 +1327,17 @@ The `afterLast` method returns everything after the last occurrence of the given
1314
1327
1315
1328
// 'Controller'
1316
1329
1330
+
<aname="method-fluent-str-apa"></a>
1331
+
#### `apa` {.collection-method}
1332
+
1333
+
The `apa` method converts the given string to title case following the [APA guidelines](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case):
1334
+
1335
+
use Illuminate\Support\Str;
1336
+
1337
+
$converted = Str::of('a nice title uses the correct case')->apa();
0 commit comments