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

Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 0 installs, 0 updates, 1 removal - Removing genealabs/laravel-caffeine (0.3.12) Writing lock file Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover

[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'GeneaLabs\LaravelCaffeine\LaravelCaffeineServiceProvider' not found

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


I simply ran composer update and it resolved my issue - Laravel 6.*


Add this in composer.json. Then dusk has to be installed explicitly in your project:

"extra": {
    "laravel": {
        "dont-discover": [
            "laravel/dusk"
        ]
    }
},

I found this solution here


In case you're coming from a google search, make sure that you have a .env file in which APP_ENV is set to local. (if you cloned a project from github, the first thing is to run cp .env.example .env. That was actually the problem in my case)

Then run composer install again.


You have added the service provider in config/app.php for the package that is not installed in the system.

You must have this line in your config/app.php. You can either remove it or install the package GeneaLabs\LaravelCaffeine\LaravelCaffeineServiceProvider

See https://github.com/GeneaLabs/laravel-caffeine.

Run the line below via CLI to install the package.

 composer require genealabs/laravel-caffeine

My problem was fideloper proxy version.

when i upgraded laravel 5.5 to 5.8 this happened

just sharing if anybody get help

change you composer json fideloper version:

"fideloper/proxy": "^4.0",

After that you need to run update composer that's it.

composer update