8000 fix: Str title null value warning · yajra/framework@cc8d459 · GitHub
[go: up one dir, main page]

Skip to content

Commit cc8d459

Browse files
authored
fix: Str title null value warning
Fix warning when a null value was passed in `Str::title($value)`. ### Error ``` mb_convert_case(): Passing null to parameter laravel#1 ($string) of type string is deprecated ```
1 parent 25b1d76 commit cc8d459

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Support/Str.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,10 @@ public static function upper($value)
14151415
*/
14161416
public static function title($value)
14171417
{
1418+
if (is_null($value)) {
1419+
return '';
1420+
}
1421+
14181422
return mb_convert_case($value, MB_CASE_TITLE, 'UTF-8');
14191423
}
14201424

0 commit comments

Comments
 (0)
0