我正在尝试在我的Laravel 4.2项目中使用此软件包 https://github.com/laracasts/Validation。
这是我composer.json
文件条目:
"require": {
...
"laracasts/validation": "~1.0"
},
现在,当我运行作曲家更新命令时,最后出现以下错误:
{
"error":{
"type":"BadMethodCallException",
"message":"Call to undefined method [package]",
"file":"C:\wamp\www\project-name\vendor\illuminate\support\ServiceProvider.php",
"line":111
}
}{
"error":{
"type":"BadMethodCallException",
"message":"Call to undefined method [package]",
"file":"C:\wamp\www\project-name\vendor\illuminate\support\ServiceProvider.php",
"line":111
}
}
这是完整的输出:
C:wampwwwproject-name>composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
{"error":{"type":"BadMethodCallException","message":"Call to undefined method [package]","file":"C:\wamp\www\project-name\vendor\illuminate\support\ServiceProvider.php","line":111}}{"error":{"type":"BadMethodCallException","message":"Call to undefined method [package]","file":"C:\wamp\www\project-name\vendor\illuminate\support\ServiceProvider.php","line":111}}
C:wampwwwproject-name>
知道这是关于什么以及如何解决它吗?
确保使用最新版本的作曲家。使用 self-update
命令将作曲家本身更新到最新版本。
composer self-update
你确定你使用的是Laravel 4.2而不是Laravel 5吗?
Laravel 5 甚至还没有进入 alpha 阶段,所以事情随时可能破裂。
目前,laravel 5 包已完全损坏。