Upgrading Laravel 5.4 to latest version (5.7)

后端 未结 8 1675
再見小時候
再見小時候 2021-02-14 12:13

I am working on Laravel 5.4 with PHP version 5.6.4. My goal is to upgrade my project to Laravel 5.7 with PHP 7.1.

Now my question is: Do I have to upgrade to 5.5 > 5.6 >

8条回答
  •  说谎
    说谎 (楼主)
    2021-02-14 12:28

    You can just update your laravel/framework dependency to 5.7.* in your composer.json file.

    1. change in composer.json:

    From:

    "require": {
            "php": ">=7.0.0",
            "fideloper/proxy": "~3.3",
            "laravel/framework": "5.4.*",
            "laravel/tinker": "~1.0"
        },
    

    To:

    "require": {
            "php": ">=7.1.3",
            "fideloper/proxy": "~4.0",
            "laravel/framework": "5.6.*",
            "laravel/tinker": "~1.0"
        },
    

    2. Replace app\Http\Middleware\TrustedProxies.php file with contents below:

    3. composer update

    composer update
    

提交回复
热议问题