方法 Illuminate\Support\Str::音译不存在

Method Illuminate\Support\Str::transliterate does not exist

我正在使用:

Laravel: 9.x-dev

PHP: 8.1.5

laravel/ui: v3.4.5

将我的应用程序从 Laravel 8 更新到 Laravel 9 后,我在尝试进行身份验证时遇到此错误。

它引用 vendor\laravel\ui\auth-backend\ThrottlesLogins.php

中的行 92
   protected function throttleKey(Request $request)

{

    return Str::transliterate(Str::lower($request->input($this->username())).'|'.$request->ip());

}

解决方案

尝试运行这个命令:

composer update

确保您导入了这个 class 例如:

use Illuminate\Support\Str;

希望有用

我通过更改 Laravel 关闭作曲家的 dev 版本解决了这个错误。在我的例子中,从 9.x-dev9.1.5