skip to Main Content

I have been googling and reading on this for several days.
I am unable to update my Laravel project from 5.7 to 5.8, due to dependencies. When I update the dependency package version values in composer.json and try to perform a laravel update, it ignores my updates, and actually reverts them back to the original values.

Composer.json

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": "^7.1.3",
    "anhskohbo/no-captcha": "^3.0",
    "chriskonnertz/open-graph": "^1.0",
    "cmgmyr/messenger": "^2.16",
    "cviebrock/eloquent-sluggable": "^4.6",
    "doctrine/dbal": "^2.8",
    "egeloen/http-adapter": "^1.0",
    "eilander/gateway": "^5.6",
    "exodusanto/administrator": " 5.7.*",
    "fideloper/proxy": "^4.0",
    "fzaninotto/faker": "^1.8",
    "geocoder-php/bing-maps-provider": "^4.0",
    "geocoder-php/chain-provider": "^4.0",
    "geocoder-php/google-maps-provider": "^4.2",
    "geoip2/geoip2": "^2.9",
    "hemp/presenter": "^1.0",
    "hieu-le/active": "^3.5",
    "htmlmin/htmlmin": "^5.8",
    "intervention/image": "^2.4",
    "laravel/framework": "5.7.*",
    "laravel/passport": "^7.0",
    "laravel/socialite": "^4.1",
    "laravel/tinker": "^1.0",
    "laravelcollective/html": "^5.7",
    "league/period": "4.1.0",
    "maatwebsite/excel": "^3.1",
    "morrislaptop/laravel-queue-clear": "^1.1",
    "php-http/guzzle6-adapter": "^1.1",
    "php-http/message": "^1.7",
    "phpoffice/phpspreadsheet": "^1.5",
    "pragmarx/firewall": "^2.2",
    "predis/predis": "^1.1",
    "prettus/l5-repository": "^2.6",
    "prettus/laravel-validation": "^1.1",
    "ryanwinchester/hubspot-php": "~1.0",
    "sammyk/laravel-facebook-sdk": "^3.5",
    "santigarcor/laratrust": "^5.0",
    "spatie/laravel-newsletter": "^4.2",
    "toin0u/geocoder-laravel": "^4.0",
    "torann/geoip": "^1.0",
    "venturecraft/revisionable": "^1.28",
    "watson/sitemap": "^2.0",
    "yajra/laravel-datatables-oracle": "^8.9"
},
"require-dev": {
    "beyondcode/laravel-dump-server": "^1.0",
    "filp/whoops": "^2.0",
    "mockery/mockery": "^1.0",
    "nunomaduro/collision": "^2.0",
    "phpunit/phpunit": "^7.0"
},
"autoload": {
    "classmap": [
        "database/seeds",
        "database/factories"
    ],
    "psr-4": {
        "App\": "app/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\": "tests/"
    }
},
"extra": {
    "laravel": {
        "dont-discover": [
        ]
    }
},
"scripts": {
    "post-root-package-install": [
        "@php -r "file_exists('.env') || copy('.env.example', '.env');""
    ],
    "post-create-project-cmd": [
        "@php artisan key:generate"
    ],
    "post-autoload-dump": [
        "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover"
    ]
},
"config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true

}

Steps I take:

1) Edit my composer.json file, changing: “laravel/framework”: “5.7.
to: “laravel/framework”: “5.8.

2) Run composer update

Output:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run ".vendorbinupgrade-carbon" to get help in updating carbon and other frameworks and libraries that depend on it.
> IlluminateFoundationComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: anhskohbo/no-captcha
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: chriskonnertz/open-graph
Discovered Package: cmgmyr/messenger
Discovered Package: cviebrock/eloquent-sluggable
Discovered Package: exodusanto/administrator
Discovered Package: fideloper/proxy
Discovered Package: hemp/presenter
Discovered Package: hieu-le/active
Discovered Package: htmlmin/htmlmin
Discovered Package: intervention/image
Discovered Package: laravel/nexmo-notification-channel
Discovered Package: laravel/passport
Discovered Package: laravel/slack-notification-channel
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: laravelcollective/html
Discovered Package: maatwebsite/excel
Discovered Package: morrislaptop/laravel-queue-clear
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: pragmarx/firewall
Discovered Package: prettus/l5-repository
Discovered Package: sammyk/laravel-facebook-sdk
Discovered Package: santigarcor/laratrust
Discovered Package: spatie/laravel-newsletter
Discovered Package: toin0u/geocoder-laravel
Discovered Package: torann/geoip
Discovered Package: watson/sitemap
Discovered Package: yajra/laravel-datatables-oracle
Package manifest generated successfully.

Result:

composer.json file has been reset to show : “laravel/framework”: “5.7.*”

Things I’ve tried:
1) Deleting the composer.lock file prior to attempting this.
2) Performing a php artisan cache:clear prior to my updates.

There has to be someone out there who has experienced these issues that can help me out.

3

Answers


  1. Chosen as BEST ANSWER

    Turns out the IDE (Eclipse Neon) was never updating my composer.json file even though it indicated I was. I edited it from the command line, and it worked.


  2. My personal experiences in this sort of situations has learned me to create a brand new project with new version of Laravel and then add my personal changes (i.e. controllers, models, migrations, views, configurations, etc.). Of course using unit tests will help you a lot to successfully upgrade your project to the next level.

    BTW. this link may help you to upgrade safely but again, I highly recommend to use a brand new installation instead of dealing with a mess of changes.

    Login or Signup to reply.
  3. Just follow the Official Upgrade Guide:

    1. Update your composer.json laravel/framework to 5.8.*
    2. Run composer update. There’s no need to deleting `composer.lock
    3. Check the upgrade guide above for changes that might affect uour application. This version have almost no breaking changes.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search