I installed the Spatie Laravel Backup package.
It works fine on my local machine but when I push to Laravel Forge / Digital Ocean I get the following error message.
Package operations: 3 installs, 0 updates, 0 removals
- Installing spatie/temporary-directory (1.3.0): Loading from cache
- Installing spatie/db-dumper (2.21.1): Loading from cache
- Installing spatie/laravel-backup (6.15.0): Loading from cache
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
In Container.php line 1017:
Target [Spatie\Backup\Tasks\Cleanup\CleanupStrategy] is not instantiable wh
ile building [Spatie\Backup\Commands\CleanupCommand].
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
I have tried all other solutions I could find to this problem and still no luck.
Solution Attempt 1:
Remove the package:
composer remove spatie/laravel-backup
clear the cache and config:
php artisan cache:clear
php artisan config:clear
install the package again:
composer require spatie/laravel-backup
then recache everything:
php artisan optimize
Solution Attempt 2:
Remove the config.php file located in bootstrap/cache
Doing each of these resulted in the same error.
Any other solutions out there?
Thanks for the help!