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

cherbert's avatar

Spark - cannot create a new project

I have installed composer and both the laravel and spark installers. When I do spark new MyProject I get a FatalExceptionError.

[Symfony\Component\Debug\Exception\FatalErrorException] Class 'Laravel\Spark\Providers\SparkServiceProvider' not found

PHP Fatal error: Class 'Laravel\Spark\Providers\SparkServiceProvider' not found in /var/www/dev/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146

0 likes
14 replies
cherbert's avatar

Try installing Composer from the official website rather than using your distro version. This fixed it for me.

timokfine's avatar

I'm also having this issue.

[Symfony\Component\Debug\Exception\FatalThrowableError]
Fatal error: Class 'Laravel\Spark\Providers\SparkServiceProvider' not found

All I've done is install Homestead and attempt to install Spark. This error message shows on composer install from inside the new Spark project directory.

Any ideas?

pifer82's avatar

Same, everything seems to be in place though... can't figure it out.

aarongwebster's avatar

Hey all, I had this error but was able to correct it after a lot of trial and error.

From this documenation page ( https://spark.laravel.com/docs/1.0/installation ) , I was trying to install via the 'Spark Installer' method. I was getting this error in the console after running spark new {project-name}

Warning: require(/Applications/MAMP/htdocs/{project-name}/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/{project-name}/bootstrap/autoload.php on line 17

Call Stack: 0.0017 234128 1. {main}() /Applications/MAMP/htdocs/{project-name}/artisan:0 0.0019 236792 2. require('/Applications/MAMP/htdocs/{project-name}/bootstrap/autoload.php') /Applications/MAMP/htdocs/{project-name}/artisan:16

Fatal error: require(): Failed opening required '/Applications/MAMP/htdocs/{project-name}/bootstrap/../vendor/autoload.php' (include_path='.:/Applications/MAMP/bin/php/php5.6.2/lib/php') in /Applications/MAMP/htdocs/{project-name}/bootstrap/autoload.php on line 17

Call Stack: 0.0017 234128 1. {main}() /Applications/MAMP/htdocs/{project-name}/artisan:0 0.0019 236792 2. require('/Applications/MAMP/htdocs/{project-name}/bootstrap/autoload.php') /Applications/MAMP/htdocs/{project-name}/artisan:16

Because of this, some necessary setup was not taking place. I have NOT resolved this error. I noticed that my project did contain 'SparkServiceProvider', but it was within:

/spark/install-stubs/app/Providers/

This is not good! It is supposed to be copied into:

app/Providers.

However, to get around this, I followed the 'Installation Via Composer' instructions and it worked the first time I tried it. Be sure to follow every step carefully.

I hope this helps someone. Was a pain in the neck! If anyone knows why I would be getting the error with the spark installer, that would be great to share.

1 like
teesquare's avatar

thanks for the help, that solved my problem too ... this is very buggy for $99!

1 like
coeuscc's avatar

So I ran across the same issue and was saddened to see that it was unresolved. Since I left my install procedure unattended for a short time, I figured I would go back and see if there were any errors. Sure enough I hadn't pulled in a PHP extension:

- laravel/cashier v6.0.9 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2].
    - stripe/stripe-php v3.9.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.

http://imgur.com/a/khMxe

I deleted my folder, installed the dependency, and was able to rerun the spark installer without issues. There may be room for better error reporting, or rolling back the install if dependencies aren't met, but it is for certain that in my case it was my environment that lacked the proper configuration, and not this brilliant piece of $100 software (which I actually only bought because it was half-priced yesterday :D)

StefanVoinea's avatar

https://spark.laravel.com/docs/3.0/installation

pay attention to this note

Note: The Spark installer is only recommended for those on Mac or Linux systems. If you are using Windows, please install via Composer. Before using the Spark installer, make sure you have installed the Laravel installer.

albertbalada's avatar

I'm using a Mac MacBook Pro (Retina, 15-inch, Late 2013) 2,3 GHz Intel Core i7 MacOs Sierra 10.12.6 (16G29)

...and I'm facing the same issue with Spark Installer... :-(

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

uju's avatar

You will most likely need to update composer itself. composer self-update then try using the Spark installer

designbinario's avatar

1 - Comment "App\Providers\AppServiceProvider::class," in your config/app.php, 2 - Run in terminal "php artisan spark:install --force", 3 - Comment out "App\Providers\AppServiceProvider::class," in your config/app.php

2 likes
Nicholaus's avatar

I was getting the same problem... until I ran composer install in the spark-installer directory I had cloned the repo into... I definitely felt like an idiot.

1 like

Please or to participate in this conversation.