我目前正在更新到Laravel 5.4并且在控制台中遇到以下错误。
宣言 软件\供应商\ EventServiceProvider ::启动(照亮\合同
s \ Events \ Dispatcher $ events)应与之兼容 照亮\ Foundatio
Ñ\支持\提供商\ EventServiceProvider ::引导()
这是我的 composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.4.*",
"illuminate/html": "5.0.*",
"laravelcollective/html": "^5.4.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
答案 0 :(得分:2)
你正在更新到5.4,所以有些事情会发生变化。
boot方法不再需要传递给它的参数,父类也不需要:
从函数和parent::boot()
中完全删除参数,因此没有参数传递给:
public function boot()
{
parent::boot();
}
答案 1 :(得分:2)
我认为您的应用程序可能正在缓存已编译的文件,升级后对我有用的一种解决方案是重新创建以下目录的空目录:
引导程序/缓存
将现有文件夹重命名为不同的临时名称,然后创建一个新的目录引导程序/缓存并应用权限/所有权,那么一切就很好了。