如何升级laravel项目从版本9.52.8到10 [已关闭]

68de4m5k  于 2023-06-25  发布在  其他
关注(0)|答案(1)|浏览(178)

**已关闭。**此问题正在寻求书籍、工具、软件库等的建议。它不符合Stack Overflow guidelines。目前不接受答复。

我们不允许问题寻求书籍,工具,软件库等的建议。您可以编辑问题,以便可以用事实和引用来回答。
14天前关闭
Improve this question
我想把Laravel从9.52.8版本更新到10。我如何做到这一点,而不必重新下载一个新的项目?
这是composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^8.0",
        "bensampo/laravel-enum": "^6.3",
        "fruitcake/laravel-cors": "^2.0.5",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^9.0",
        "laravel/sanctum": "^2.14",
        "laravel/tinker": "^2.7",
        "laravel/ui": "^4.2",
        "maatwebsite/excel": "^3.1",
        "phpoffice/phpspreadsheet": "^1.28",
        "spatie/laravel-medialibrary": "^10.5",
        "spatie/laravel-query-builder": "^5.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^6.1",
        "phpunit/phpunit": "^9.5.10",
        "spatie/laravel-ignition": "^1.0"
    },
kxkpmulp

kxkpmulp1#

升级的快速建议,更改您的依赖项如下:

"require": {
    "php": "^8.1",
    "bensampo/laravel-enum": "^6.3",
    "guzzlehttp/guzzle": "^7.7",
    "laravel/framework": "^10.13",
    "laravel/sanctum": "^3.2",
    "laravel/tinker": "^2.8",
    "laravel/ui": "^4.2",
    "maatwebsite/excel": "^3.1",
    "phpoffice/phpspreadsheet": "^1.28",
    "spatie/laravel-medialibrary": "^10.7",
    "spatie/laravel-query-builder": "^5.2"
  },
  "require-dev": {
    "fakerphp/faker": "^1.12",
    "laravel/sail": "^1.22",
    "mockery/mockery": "^1.6",
    "nunomaduro/collision": "^7.5",
    "phpunit/phpunit": "^10.2",
    "spatie/laravel-ignition": "^2.1"
  }

然后从你的项目中删除fruitcake/laravel-cors包,因为这个包添加到laravel核心依赖项中。在sanctum表中添加expire at列。把你的php版本升级到8.1。检查使用过的包,如“bensampo/laravel-enum”,以确定laravel 10是否可用。

相关问题