Skip to content

[10.x] Create fluent method convertCase #48492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Sep 21, 2023
12 changes: 12 additions & 0 deletions src/Illuminate/Support/Stringable.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ public function containsAll($needles, $ignoreCase = false)
return Str::containsAll($this->value, $needles, $ignoreCase);
}

/**
* Convert the case of a string.
*
* @param int $mode
* @param string $encoding
* @return string
*/
public function convertCase(int $mode = MB_CASE_FOLD, ?string $encoding = 'UTF-8')
{
return new static(Str::convertCase($this->value, $mode, $encoding));
}

/**
* Get the parent directory's path.
*
Expand Down