I recently updated a Laravel/Spark web application to the latest version of Spark (v9.*
) via composer
. Another package I use is Laravel-Spark-Google2FA which I also updated from v1.*
to v2.*
.
Setup:
The laravel-spark-google2fa package has a Laravel service provider class that resides in /project-root/laravel/spark/src/Providers/Google2FAServiceProvider.php
In Laravel we specify this in /project-root/laravel/config/app.php
with the following line in the providers
array:
Laravel\Spark\Providers\Google2FAServiceProvider::class,
In composer.json
we have:
"require": {
...
"doctrine/dbal": "^2.5",
"laravel/framework": "^6.0.0",
"eusebiu/laravel-spark-google2fa": "^2.0.0",
"laravel/cashier": "^10.0.0",
"laravel/spark-aurelius": "^9.0.0",
"laravel/tinker": "^1.0.0",
"laravelcollective/html": "^6.0.0",
"webpatser/laravel-uuid": "2.*"
},
"autoload": {
...
"psr-4": {
"App\\": "app/"
}
},
...
Note: aside from the higher version numbers you see above in the require
section, this has been the setup for a long time with the web application running successfully during that time.
Error:
Since we upgraded laravel/spark
to laravel/spark-aurelius: ^9.0.0
we've run into one error which prevents the application from running:
In ProviderRepository.php line 208:
Class 'Laravel\Spark\Providers\Google2FAServiceProvider' not found
Failed attempts
We have tried the following to fix this, none of which have worked:
- running
php artisan config:clear
- running
php artisan cache:clear
- running
composer dump-autoload
- as per laravel-spark-google2fa docs, running
php artisan vendor:publish --provider="Eusebiu\LaravelSparkGoogle2FA\Google2FAServiceProvider" --force
- changing how the service provider is specified in
app.php
- added a new path to
autoload
incomposer.json
- downgrading
laravel-spark-google2fa
to an earlier version - removing and re-installing
laravel-spark-google2fa
- running
spark-installer
over the existing application
In all of the above cases the error remains, preventing the application from running.
The laravel-spark-google2fa
package may be recently abandoned. I opened an issue there and haven't heard a reply. Laravel/Spark support has not suggested a solution. So I am posting here as a last resort before getting rid of this package and refactoring my code to use a different one.