diff --git a/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php b/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php index 32a007573e5d..37cb55fe36c7 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php +++ b/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php @@ -12,6 +12,7 @@ use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query\Builder as QueryBuilder; use Illuminate\Database\Query\Expression; +use Illuminate\Support\Casing; use Illuminate\Support\Str; use InvalidArgumentException; @@ -627,7 +628,7 @@ public function withAggregate($relations, $column, $function = null) unset($alias); - if (count($segments) === 3 && Str::lower($segments[1]) === 'as') { + if (count($segments) === 3 && Casing::lower($segments[1]) === 'as') { [$name, $alias] = [$segments[0], $segments[2]]; } diff --git a/src/Illuminate/Foundation/Console/DocsCommand.php b/src/Illuminate/Foundation/Console/DocsCommand.php index b8a36749ec2d..af9035ad87fc 100644 --- a/src/Illuminate/Foundation/Console/DocsCommand.php +++ b/src/Illuminate/Foundation/Console/DocsCommand.php @@ -7,6 +7,7 @@ use Illuminate\Contracts\Cache\Repository as Cache; use Illuminate\Http\Client\Factory as Http; use Illuminate\Support\Arr; +use Illuminate\Support\Casing; use Illuminate\Support\Collection; use Illuminate\Support\Env; use Illuminate\Support\Str; @@ -235,15 +236,15 @@ protected function askForPageViaAutocomplete() label: 'Which page would you like to open?', options: fn ($value) => $this->pages() ->mapWithKeys(fn ($option) => [ - Str::lower($option['title']) => $option['title'], + Casing::lower($option['title']) => $option['title'], ]) - ->filter(fn ($title) => str_contains(Str::lower($title), Str::lower($value))) + ->filter(fn ($title) => str_contains(Casing::lower($title), Casing::lower($value))) ->all(), placeholder: 'E.g. Collections' ); return $this->pages()->filter( - fn ($page) => $page['title'] === $choice || Str::lower($page['title']) === $choice + fn ($page) => $page['title'] === $choice || Casing::lower($page['title']) === $choice )->keys()->first() ?: $this->guessPage($choice); } diff --git a/src/Illuminate/Foundation/Console/ViewMakeCommand.php b/src/Illuminate/Foundation/Console/ViewMakeCommand.php index 3f8e4da6a639..6f91520af7c4 100644 --- a/src/Illuminate/Foundation/Console/ViewMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ViewMakeCommand.php @@ -5,6 +5,7 @@ use Illuminate\Console\Concerns\CreatesMatchingTest; use Illuminate\Console\GeneratorCommand; use Illuminate\Foundation\Inspiring; +use Illuminate\Support\Casing; use Illuminate\Support\Facades\File; use Illuminate\Support\Str; use Symfony\Component\Console\Attribute\AsCommand; @@ -181,7 +182,7 @@ protected function testClassName() */ protected function testClassFullyQualifiedName() { - $name = Str::of(Str::lower($this->getNameInput()))->replace('.'.$this->option('extension'), ''); + $name = Str::of(Casing::lower($this->getNameInput()))->replace('.'.$this->option('extension'), ''); $namespacedName = Str::of( Str::of($name) diff --git a/src/Illuminate/Support/Stringable.php b/src/Illuminate/Support/Stringable.php index 6ae57e032066..b920e3568c32 100644 --- a/src/Illuminate/Support/Stringable.php +++ b/src/Illuminate/Support/Stringable.php @@ -459,7 +459,7 @@ public function limit($limit = 100, $end = '...', $preserveWords = false) */ public function lower() { - return new static(Str::lower($this->value)); + return new static(Casing::lower($this->value)); } /** diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php index 5628e43783c9..522d2e1da4ef 100644 --- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php @@ -18,6 +18,7 @@ use Illuminate\Container\Container; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Arr; +use Illuminate\Support\Casing; use Illuminate\Support\Exceptions\MathException; use Illuminate\Support\Facades\Date; use Illuminate\Support\Str; @@ -1353,7 +1354,7 @@ public function validateLte($attribute, $value, $parameters) */ public function validateLowercase($attribute, $value, $parameters) { - return Str::lower($value) === $value; + return Casing::lower($value) === $value; } /** @@ -1366,7 +1367,7 @@ public function validateLowercase($attribute, $value, $parameters) */ public function validateUppercase($attribute, $value, $parameters) { - return Str::upper($value) === $value; + return Casing::upper($value) === $value; } /** @@ -2290,7 +2291,7 @@ protected function convertValuesToBoolean($values) protected function convertValuesToNull($values) { return array_map(function ($value) { - return Str::lower($value) === 'null' ? null : $value; + return Casing::lower($value) === 'null' ? null : $value; }, $values); }