Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

benddennis's avatar

Class 'App\Providers\SparkServiceProvider' not found when running composer install on Homestead boc

when running 'composer install' from the root directory of my project on my Homestead box, I get the following error:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover


  [Symfony\Component\Debug\Exception\FatalThrowableError]
  Class 'App\Providers\SparkServiceProvider' not found


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

I'm not sure why this is happening. Any help is appreciated.

0 likes
1 reply
benddennis's avatar

Solved it. I already had a spark project setup, but hadn't run composer install. to run composer install, I first commented out "App\Providers\SparkServiceProvider::class," line from app.php in config. Then I ran composer install successfully. Then I ran php artisan spark:install --force. Then uncommented out "App\Providers\SparkServiceProvider::class," line from app.php in config.

1 like

Please or to participate in this conversation.