Ad

After Update To Laravel 7 Php Artisan Not Working

- 1 answer

after upgrading Laravel according to the docs to v7 I ran composer update. Then I'm getting this:

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

This is my composer.json file:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "guzzlehttp/guzzle": "^6.5",
        "kitetail/zttp": "^0.6.0",
        "laravel/framework": "^7.0",
        "laravel/tinker": "^2.0",
        "laravel/telescope": "^2.1",
        "laravelcollective/html": "^6.0",
        "livewire/livewire": "^0.7.4",
        "spatie/laravel-html": "^2.24",
        "spatie/laravel-permission": "^3.0.0"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.2",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "laravel/ui": "^2.0",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^4.1",
        "phpunit/phpunit": "^7.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"
        ]
    }
}

I'm confused right now. It even seems that php artisan doesn't do anything in this project. In other projects it's just working fine. Any idea how this could be fixed?

Edit: Some of the answers provided suggestions. I'm getting the following using Laragon:

PS C:\laragon\www\attila> composer update
Updating dependencies (including require-dev)
Package operations: 0 installs, 4 updates, 0 removals
  - Updating laravel/framework (v7.0.1 => v7.0.2): Downloading (100%)
  - Updating spatie/laravel-permission (3.10.1 => 3.11.0): Downloading (100%)
  - Updating laravel/ui (v2.0.0 => v2.0.1): Downloading (100%)
  - Updating nunomaduro/collision (v4.1.1 => v4.1.2): Downloading (100%)
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Writing lock file
Generating optimized autoload files
> @php artisan package:discover --ansi
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
PS C:\laragon\www\attila> php artisan package:discover --ansi
PS C:\laragon\www\attila>
Ad

Answer

After deleting all the cache in bootstrap & storage/framework folders, still no results.

Running the php artisan --help returns some errors, this gave me a hint where the problem is.

After checking the Upgrade Guide I solved the issue, for me it was:

  • Changes in App\Exceptions\Handler methods
  • install require laravel/ui package
Ad
source: stackoverflow.com
Ad