Deleting the cache is not a suitable option (for me), as it seems to regenerate a new one with an error. Another solution (above) is to modify the cache, and remove the error that way, but that didn't solve it either.
My error occurred trying to restore a non-working website version that was partially upgraded. My composer file was not valid and the requirements in it were wrong. I removed all the conflicting requirements using the composer remove command.
But then I got the error above with the CashierServiceProvider class. If this exists on another class for you, the solution I used might work but you will need to do this for your class.
First, commenting the Cashier Service worked for me in app\config.php got rid of the error.
Laravel\Cashier\CashierServiceProvider::class,
Then I installed the cashier Laravel app.
composer require laravel/cashier