fbc
1 month ago
268
5
Laravel

Upgrade from 6 to 7 failed

Posted 1 month ago by fbc

I replaced the dependencies and did a composer update and got this:

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
PHP Fatal error:  Declaration of App\Exceptions\Handler::report(Exception $exception) must be compatible with Illuminate\Foundation\Exceptions\Handler::report(Throwable $e) in /home/xxx/LaravelRoot/app/app/Exceptions/Handler.php on line 35
PHP Stack trace:
PHP   1. {main}() /home/xxx/LaravelRoot/app/artisan:0
PHP   2. App\Console\Kernel->handle() /home/xxx/LaravelRoot/app/artisan:37
PHP   3. App\Console\Kernel->bootstrap() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:127
PHP   4. Illuminate\Foundation\Application->bootstrapWith() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:310
PHP   5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:230
PHP   6. Illuminate\Foundation\Application->registerConfiguredProviders() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php:17
PHP   7. Illuminate\Foundation\ProviderRepository->load() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:604
PHP   8. Illuminate\Foundation\Application->register() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php:75
PHP   9. NunoMaduro\Collision\Adapters\Laravel\CollisionServiceProvider->register() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:627
PHP  10. Illuminate\Foundation\Application->make() /home/xxx/LaravelRoot/app/vendor/nunomaduro/collision/src/Adapters/Laravel/CollisionServiceProvider.php:72
PHP  11. Illuminate\Foundation\Application->make() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:781
PHP  12. Illuminate\Foundation\Application->resolve() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:637
PHP  13. Illuminate\Foundation\Application->resolve() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:796
PHP  14. Illuminate\Foundation\Application->build() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:691
PHP  15. Illuminate\Foundation\Application->Illuminate\Container\{closure:/home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:263-271}() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:805
PHP  16. Illuminate\Foundation\Application->resolve() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:269
PHP  17. Illuminate\Foundation\Application->resolve() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:796
PHP  18. Illuminate\Foundation\Application->build() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:691
PHP  19. ReflectionClass->__construct() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
PHP  20. spl_autoload_call() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
PHP  21. Composer\Autoload\ClassLoader->loadClass() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
PHP  22. Composer\Autoload\includeFile() /home/xxx/LaravelRoot/app/vendor/composer/ClassLoader.php:322
PHP  23. include() /home/xxx/LaravelRoot/app/vendor/composer/ClassLoader.php:444
PHP Fatal error:  Uncaught ReflectionException: Class App\Exceptions\Handler does not exist in /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
Stack trace:
#0 /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php(809): ReflectionClass->__construct()
#1 /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php(691): Illuminate\Container\Container->build()
#2 /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(796): Illuminate\Container\Container->resolve()
#3 /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php(269): Illuminate\Foundation\Application->resolve()
#4 /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->Illuminate\Container\{closure}()
#5 /home/xxx/LaravelRoot/app/vendor/larave in /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 811
PHP Stack trace:
PHP   1. {main}() /home/xxx/LaravelRoot/app/artisan:0
PHP   2. App\Console\Kernel->handle() /home/xxx/LaravelRoot/app/artisan:37
PHP   3. App\Console\Kernel->bootstrap() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:127
PHP   4. Illuminate\Foundation\Application->bootstrapWith() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:310
PHP   5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:230
PHP   6. Illuminate\Foundation\Application->registerConfiguredProviders() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php:17
PHP   7. Illuminate\Foundation\ProviderRepository->load() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:604
PHP   8. Illuminate\Foundation\Application->register() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php:75
PHP   9. NunoMaduro\Collision\Adapters\Laravel\CollisionServiceProvider->register() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:627
PHP  10. Illuminate\Foundation\Application->make() /home/xxx/LaravelRoot/app/vendor/nunomaduro/collision/src/Adapters/Laravel/CollisionServiceProvider.php:72
PHP  11. Illuminate\Foundation\Application->make() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:781
PHP  12. Illuminate\Foundation\Application->resolve() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:637
PHP  13. Illuminate\Foundation\Application->resolve() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:796
PHP  14. Illuminate\Foundation\Application->build() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:691
PHP  15. Illuminate\Foundation\Application->Illuminate\Container\{closure:/home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:263-271}() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:805
PHP  16. Illuminate\Foundation\Application->resolve() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:269
PHP  17. Illuminate\Foundation\Application->resolve() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:796
PHP  18. Illuminate\Foundation\Application->build() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:691
PHP  19. ReflectionClass->__construct() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
PHP  20. spl_autoload_call() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
PHP  21. Composer\Autoload\ClassLoader->loadClass() /home/xxx/LaravelRoot/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
PHP  22. Composer\Autoload\includeFile() /home/xxx/LaravelRoot/app/vendor/composer/ClassLoader.php:322
PHP  23. include() /home/xxx/LaravelRoot/app/vendor/composer/ClassLoader.php:444
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

What am I doing wrong? The instructions on the upgrade page just say to replace dependencies in composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2",
        "barryvdh/laravel-dompdf": "^0.8.6",
        "consoletvs/charts": "6.*",
        "doctrine/dbal": "^2.10",
        "fideloper/proxy": "^4.0",
        "jeroennoten/laravel-adminlte": "^3.0",
        "laravel/framework": "^7.0",
        "laravel/tinker": "^2.0",
        "laravel/ui": "^2.4",
        "laravelcollective/html": "^6.0",
        "okipa/laravel-bootstrap-components": "^2.0",
        "orangehill/iseed": "^2.6",
        "spinen/laravel-quickbooks-client": "^4.0",
        "unisharp/laravel-filemanager": "^2.1"
    },
    "require-dev": {
        "barryvdh/laravel-ide-helper": "^2.7",
        "facade/ignition": "^2.0",
        "fzaninotto/faker": "^1.4",
        "laracasts/generators": "^1.1",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^4.1",
        "phpunit/phpunit": "^8.5",
        "squizlabs/php_codesniffer": "^3.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

Please sign in or create an account to participate in this conversation.