我正在尝试从6->更新我的Laravel版本;8遵循本指南https://laravel.com/docs/8.x/upgrade
我不确定我是否应该先更新到Laravel 7,然后更新到8,更不用说了,我在尝试更新到7时也面临着同样的作曲家问题。
composer更新输出:
Problem 1
- illuminate/database 5.7.17 requires illuminate/support 5.7.* -> satisfiable by laravel/framework[5.7.x-dev], illuminate/support[5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].
- illuminate/database v5.4.9 requires nesbot/carbon ~1.20 -> satisfiable by nesbot/carbon[1.20.0, 1.21.0, 1.22.0, 1.22.1, 1.23.0, 1.24.0, 1.24.1, 1.24.2, 1.25.0, 1.25.1, 1.25.3, 1.26.0,
1.26.1, 1.26.2, 1.26.3, 1.26.4, 1.26.5, 1.26.6, 1.27.0, 1.28.0, 1.29.0, 1.29.1, 1.29.2, 1.30.0, 1.31.0, 1.31.1, 1.32.0, 1.33.0, 1.34.0, 1.34.1, 1.34.2, 1.34.3, 1.34.4, 1.35.0, 1.35.1, 1.36.0, 1.36.1, 1.36.2, 1.37.0, 1.37.1, 1.38.0, 1.38.1, 1.38.2, 1.38.3, 1.38.4, 1.39.0, 1.39.1] but these conflict with your requirements or minimum-stability.
- Conclusion: don't install laravel/framework v7.28.4
- Installation request for roave/security-advisories dev-master -> satisfiable by roave/security-advisories[dev-master].
- silber/bouncer v1.0.0-rc.6 requires illuminate/database 5.1.20 - 5.8|^6.0 -> satisfiable by laravel/framework[v6.7.0, 5.1.x-dev, 5.2.x-dev, 5.3.x-dev, 5.4.x-dev, 5.5.x-dev, 5.6.x-dev,
5.7.x-dev, 5.8.x-dev, 6.x-dev], illuminate/database[5.1.x-dev, 5.2.x-dev, 5.3.x-dev, 5.4.x-dev, 5.5.x-dev, 5.6.x-dev, 5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, 5.8.x-dev, 6.x-dev, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.36, v5.8.4, v5.8.8, v5.8.9, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.1.0, v6.10.0, v6.11.0, v6.12.0, v6.13.0, v6.13.1, v6.14.0, v6.15.0, v6.15.1, v6.16.0, v6.17.0, v6.17.1, v6.18.0, v6.18.1, v6.18.10, v6.18.11,
v6.18.12, v6.18.13, v6.18.14, v6.18.15, v6.18.16, v6.18.17, v6.18.18, v6.18.19, v6.18.2, v6.18.20, v6.18.21, v6.18.22, v6.18.23, v6.18.24, v6.18.25, v6.18.26, v6.18.27, v6.18.28, v6.18.29, v6.18.3, v6.18.30, v6.18.31, v6.18.32, v6.18.33, v6.18.34, v6.18.35, v6.18.36, v6.18.37, v6.18.38, v6.18.39, v6.18.4, v6.18.40, v6.18.41, v6.18.42, v6.18.5, v6.18.6, v6.18.7, v6.18.8, v6.18.9, v6.2.0, v6.3.0, v6.4.1, v6.5.0, v6.5.1, v6.5.2, v6.6.0, v6.6.1, v6.6.2, v6.7.0, v6.8.0].
- Can only install one of: laravel/framework[7.x-dev, 5.8.x-dev].
- don't install illuminate/database 5.8.x-dev|don't install laravel/framework 7.x-dev
- Installation request for laravel/framework ^7.0 -> satisfiable by laravel/framework[7.x-dev, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.10.0, v7.10.1, v7.10.2, v7.10.3, v7.11.0, v7.12.0, v7.13.0, v7.14.0, v7.14.1, v7.15.0, v7.16.0, v7.16.1, v7.17.0, v7.17.1, v7.17.2, v7.18.0, v7.19.0, v7.19.1, v7.2.0, v7.2.1, v7.2.2, v7.20.0, v7.21.0, v7.22.0, v7.22.1, v7.22.2, v7.22.3, v7.22.4, v7.23.0, v7.23.1, v7.23.2, v7.24.0, v7.25.0, v7.26.0, v7.26.1, v7.27.0, v7.28.0, v7.28.1, v7.28.2, v7.28.3, v7.28.4, v7.3.0, v7.4.0, v7.5.0, v7.5.1, v7.5.2, v7.6.0, v7.6.1, v7.6.2, v7.7.0, v7.7.1, v7.8.0, v7.8.1, v7.9.0, v7.9.1, v7.9.2].
- Installation request for silber/bouncer v1.0.0-rc.6 -> satisfiable by silber/bouncer[v1.0.0-rc.6].
composer.json要求:
"require": {
"php": "^7.2",
"ext-curl": "*",
"ext-pdo": "*",
"bugsnag/bugsnag-laravel": "^2.17",
"doctrine/dbal": "2.9.3",
"felixkiss/uniquewith-validator": "^3.1",
"fideloper/proxy": "^4.0",
"firebase/php-jwt": "^5.2",
"lab404/laravel-impersonate": "^1.2",
"laravel/framework": "^7.0",
"laravel/helpers": "^1.1",
"laravel/passport": "^8.0.1",
"laravel/socialite": "^4.3",
"laravel/tinker": "^2.0",
"laravelcollective/html": "^6.0.3",
"league/flysystem-aws-s3-v3": "^1.0",
"league/flysystem-cached-adapter": "^1.0",
"maatwebsite/excel": "^3.1",
"moontoast/math": "^1.2",
"mpociot/laravel-apidoc-generator": "^3.10",
"mpociot/laravel-test-factory-helper": "^1.2",
"nesbot/carbon": "^2.27",
"nicolaslopezj/searchable": "^1.12",
"pdfcrowd/pdfcrowd": "^4.3",
"predis/predis": "^1.1",
"ramsey/uuid-doctrine": "^1.6",
"silber/bouncer": "v1.0.0-rc.6",
"socialiteproviders/apple": "^3.0",
"spatie/geocoder": "^3.6",
"spatie/laravel-json-api-paginate": "^1.6",
"spatie/laravel-sitemap": "^5.7",
"twilio/sdk": "^5.18",
"vimeo/vimeo-api": "^3.0",
"yajra/laravel-datatables-oracle": "^9.7"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"beyondcode/laravel-dump-server": "^1.2",
"facade/ignition": "^2.0",
"ajthinking/tinx": "^2.1",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5",
"symfony/thanks": "^1.0"
},
至少有一个您正在使用的包不支持Laravel 7或8。作曲家错误消息告诉您是哪一个。
根据错误消息,"silber/bouncer": "v1.0.0-rc.6"
最多只支持Laravel 6。查看该包的composer.json可以发现,直到v1.0.0-rc.7
才添加对Laravel 7的支持,而直到v1.0.0-rc.9
才添加对Laravel 8的支持。
您需要更新silber/bouncer
依赖项,然后重试。如果遇到另一个错误,您需要查看消息以确定哪个包不符合要求,然后确定需要使用该包的哪个版本才能满足要求。
由于Laravel 8是相当新的,您可能会遇到一些尚未更新以支持它的包(如vimeo/laravel
(。在这种情况下,您要么需要等到这些包支持它,要么派生包并尝试自己添加支持。
#1-确保composer.json看起来像这个
"require": {
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/framework": "^8.0",
"laravel/passport": "^10.0",
"laravel/socialite": "^5.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^3.0",
"predis/predis": "^1.1"
},
"require-dev": {
"facade/ignition": "^2.3.6",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9"
}
#2-如果您看到以下问题
laravel/framework取代了照明/支持,因此无法与之共存。
移除移除照亮/支持
composer remove illuminate/support
#3-应用程序的App\Exceptions\Handler类的report、render、shouldReport和renderForConsole方法应接受Throwable接口的实例,而不是Exception实例:按照更改app/Exceptions/Handler.php
<?php
namespace AppExceptions;
use Throwable;
use IlluminateFoundationExceptionsHandler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Report or log an exception.
*
* @param Throwable $exception
* @return void
*/
public function report(Throwable $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param IlluminateHttpRequest $request
* @param Throwable $exception
* @return IlluminateHttpResponse
*/
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
}