将laravel项目从5.3升级到5.8

时间:2019-06-03 09:07:38

标签: laravel-5.8 backpack-for-laravel php-7.3

我正在一个项目上,我正在尝试将当前版本的php 5.6升级到7.3,将laravel 5.3升级到5.8,将背包0.7升级到最终版本,然后运行 composer update 但我得到的只是以下错误:

Problem 1:
    - Conclusion: don't install laravel/framework v5.8.19
    - Conclusion: don't install laravel/framework v5.8.18
    - Conclusion: don't install laravel/framework v5.8.17
    - Conclusion: don't install laravel/framework v5.8.16
    - Conclusion: don't install laravel/framework v5.8.15
    - Conclusion: don't install laravel/framework v5.8.14
    - Conclusion: don't install laravel/framework v5.8.13
    - Conclusion: don't install laravel/framework v5.8.12
    - Conclusion: don't install laravel/framework v5.8.11
    - Conclusion: don't install laravel/framework v5.8.10
    - Conclusion: don't install laravel/framework v5.8.9
    - Conclusion: don't install laravel/framework v5.8.8
    - Conclusion: don't install laravel/framework v5.8.7
    - Conclusion: don't install laravel/framework v5.8.6
    - Conclusion: don't install laravel/framework v5.8.5
    - Conclusion: don't install laravel/framework v5.8.4
    - Conclusion: don't install laravel/framework v5.8.3
    - Conclusion: don't install laravel/framework v5.8.2
    - Conclusion: don't install laravel/framework v5.8.1
    - laravelcollective/html v5.3.1 requires illuminate/view 5.3.* -> satisfiable by laravel/framework[v5.3.31], illuminate/view[v5.3.0, v5.3.16, v5.3.23, v5.3.4].
    - laravelcollective/html v5.3.1 requires illuminate/view 5.3.* -> satisfiable by laravel/framework[v5.3.31], illuminate/view[v5.3.0, v5.3.16, v5.3.23, v5.3.4].
    - Can only install one of: laravel/framework[v5.8.0, v5.3.31].
    - don't install illuminate/view v5.3.0|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.3.16|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.3.23|don't install laravel/framework v5.8.0
    - don't install illuminate/view v5.3.4|don't install laravel/framework v5.8.0
    - Installation request for laravel/framework 5.8.* -> satisfiable by laravel/framework[v5.8.0, v5.8.1, v5.8.10, v5.8.11, v5.8.12, v5.8.13, v5.8.14, v5.8.15, v5.8.16, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.3, v5.8.4, v5.8.5, v5.8.6, v5.8.7, v5.8.8, v5.8.9].
    - Installation request for laravelcollective/html 5.3.1 -> satisfiable by laravelcollective/html[v5.3.1].

这是composer.json的要求

"require": {
        "php": ">=7.3.1",
        "laravel/framework": "5.3.*",
        "laravelcollective/html": "5.3.1",
        "backpack/base": "^0.7.14",
        "backpack/crud": "^3.1",
        "backpack/permissionmanager": "^2.1",
        "backpack/langfilemanager": "^1.0",
        "mikehaertl/phpwkhtmltopdf": "2.2.1",
        "artisaninweb/laravel-soap": "0.3.0.7",

1 个答案:

答案 0 :(得分:0)

在升级Laravel和/或背包时,建议您不要跳版本。我从未尝试过直接从L5.3跳到5.8,但我不希望它能起作用。

Laravel和Backpack均发布了每个版本的升级指南。那是因为升级过程不只是更改composer.json文件中的数字。它还涉及您需要手动执行的一些步骤。否则,您的应用将无法运行。我知道这很不方便,但这是升级您可以自定义的代码的唯一可能方法。

我的建议:

  1. Upgrade to Laravel 5.4 & Backpack 3.2
  2. 然后upgrade to Laravel 5.5 & Backpack 3.3
  3. 然后upgrade to Laravel 5.6 & Backpack 3.4
  4. 然后upgrade to Laravel 5.7 & Backpack 3.5
  5. 然后upgrade to Laravel 5.8 & Backpack 3.6

您可以使用Laravel Shift自动执行大部分Laravel升级。这是一项付费服务​​,可向您的Github / Gitlab / Bitbucket存储库发出拉取请求。恐怕您无法自动执行背包升级,但是在大多数情况下,这些步骤很清楚,而且更改很小。

希望有帮助。