Laravel 8 +背包错误"php artisan backpack:crud-operation SendNotification"



我安装了带有背包5.1的Laravel 8,并运行了php artisan backpack:crud-operation SendNotification,我得到了错误:

root@9139092f4397:/var/www/khm-hrms# php artisan backpack:crud-operation SendNotification
BadMethodCallException 
Method IlluminateSupportStringable::lcfirst does not exist.
at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:113
109▕      */
110▕     public function __call($method, $parameters)
111▕     {
112▕         if (! static::hasMacro($method)) {
➜ 113▕             throw new BadMethodCallException(sprintf(
114▕                 'Method %s::%s does not exist.', static::class, $method
115▕             ));
116▕         }
117▕ 
• Bad Method Call: Did you mean IlluminateSupportStringable::ucfirst() ? 
+16 vendor frames 
17  artisan:37
IlluminateFoundationConsoleKernel::handle()

有人知道问题出在哪里吗?我在网上找不到解决方案。

lcfirst用作Laravel Str::class的一部分。点击此处阅读更多信息。

看看这个问题:https://github.com/Laravel-Backpack/Generators/pull/149

您可以将软件包更新到最新版本,这一问题应该会得到解决。

您应该像Hefaz建议的那样更新Backpack包。你得到的版本有这个错误,你需要修改你的版本才能得到修复,你的PHP和Laravel版本都很好。

composer update backpack/crud

我们目前在5.4上。如果它没有说明要更新,请检查您的composer.json,以确保您没有在那里强制执行中断版本,您应该可以使用:backpack/crud: ^5.0,因为我们不会在小版本中强制执行中断更改。(有时会出现错误,但不会破坏更改呵呵:-D(

干杯

最新更新