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

christopher's avatar

Uninstalled Spark - Class 'Laravel\Cashier\CashierServiceProvider' not found

I deleted spark from my current project, but it seems that cashier is also removed because if i now run composer update i get the following error message

php artisan clear-compiled


                                                            
  [Symfony\Component\Debug\Exception\FatalErrorException]   
  Class 'Laravel\Cashier\CashierServiceProvider' not found  
                                                            


Script php artisan clear-compiled handling the post-install-cmd event returned with an error

How can i fix this error / install Laravel Cashier again.

0 likes
6 replies
christopher's avatar

solved it with "laravel/cashier": "~5.0", in my composer.json.

But isnt cashier a laravel default component?

michaeldyrynda's avatar
Level 41

If you need Cashier, you'll need to comment out the service provider line from your config/app.php, then composer require laravel/cashier=~5.0.

Once installed, you can uncomment the service provider line and you should be good to go again.

2 likes
Damayanti's avatar

But i need cashier 10

my composer file is - { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "type": "project", "require": { "php": "^7.1.3", "corcel/acf": "2.0", "fideloper/proxy": "^4.0", "jgrossi/corcel": "^3.0", "laravel/cashier": "~10", "laravel/framework": "6.0.", "laravel/spark-aurelius": "@dev", "laravel/tinker": "^1.0", "moneyphp/money": "^3.2", "spatie/laravel-newsletter": "^4.2" }, "require-dev": { "beyondcode/laravel-dump-server": "^1.0", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "mockery/mockery": "^1.0", "nunomaduro/collision": "^2.0", "phpunit/phpunit": "^7.0" }, "autoload": { "files": [ "app/Helpers/iPlay.php" ], "classmap": [ "database/seeds", "database/factories" ], "psr-4": { "App\": "app/" } }, "autoload-dev": { "psr-4": { "Tests\": "tests/" } }, "extra": { "laravel": { "dont-discover": [] } }, "scripts": { "post-root-package-install": [ "@php -r "file_exists('.env') || copy('.env.example', '.env');"" ], "post-create-project-cmd": [ "@php artisan key:generate --ansi" ], "post-autoload-dump": [ "Illuminate\Foundation\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" ] }, "config": { "preferred-install": "dist", "sort-packages": true, "optimize-autoloader": true }, "minimum-stability": "dev", "prefer-stable": true, "repositories": [ { "type": "path", "url": "./spark" } ] }

Please or to participate in this conversation.