generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for spatie/laravel-backup v9 and drop support for v8 an…
…d PHP 8.1 (#76) * Added support for spatie/laravel-backup version 9 This required all config settings to be present as described in the [upgrade guide](https://github.com/spatie/laravel-backup/blob/main/UPGRADING.md) * Updated the .gitignore file * The restore no longer asks twice for the disk to restore from * Removed the tests for PHP 8.1 as it is no longer supported by Spatie Laravel Backup * Update PHP Requirements in README * Drop Support for spatie/laravel-backup v8 --------- Co-authored-by: Stefan Zweifel <[email protected]>
- Loading branch information
1 parent
15e156c
commit 30cf0c6
Showing
6 changed files
with
80 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ phpstan.neon | |
vendor | ||
node_modules | ||
database/database.sqlite | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
namespace Workbench\App; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use ZipArchive; | ||
|
||
class BackupRestoreWorkbenchProvider extends ServiceProvider | ||
{ | ||
|
@@ -73,14 +74,30 @@ public function boot() | |
'backup' => [ | ||
'name' => env('APP_NAME', 'Laravel'), | ||
'source' => [ | ||
'files' => [ | ||
'include' => [ | ||
base_path(), | ||
], | ||
'exclude' => [ | ||
base_path('vendor'), | ||
base_path('node_modules'), | ||
], | ||
'follow_links' => false, | ||
'ignore_unreadable_directories' => false, | ||
'relative_path' => null, | ||
], | ||
'databases' => [ | ||
'mysql', | ||
], | ||
], | ||
'database_dump_compressor' => \Spatie\DbDumper\Compressors\GzipCompressor::class, | ||
'database_dump_file_timestamp_format' => null, | ||
'database_dump_filename_base' => 'database', | ||
'database_dump_file_extension' => '', | ||
|
||
'destination' => [ | ||
'compression_method' => ZipArchive::CM_DEFAULT, | ||
'compression_level' => 9, | ||
'filename_prefix' => '', | ||
'disks' => [ | ||
'remote', | ||
|
@@ -89,6 +106,60 @@ public function boot() | |
'temporary_directory' => storage_path('app/backup-temp'), | ||
'password' => env('BACKUP_ARCHIVE_PASSWORD'), | ||
'encryption' => 'default', | ||
'tries' => 1, | ||
'retry_delay' => 0, | ||
], | ||
'notifications' => [ | ||
'notifications' => [ | ||
\Spatie\Backup\Notifications\Notifications\BackupHasFailedNotification::class => ['mail'], | ||
\Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFoundNotification::class => ['mail'], | ||
\Spatie\Backup\Notifications\Notifications\CleanupHasFailedNotification::class => ['mail'], | ||
\Spatie\Backup\Notifications\Notifications\BackupWasSuccessfulNotification::class => ['mail'], | ||
\Spatie\Backup\Notifications\Notifications\HealthyBackupWasFoundNotification::class => ['mail'], | ||
\Spatie\Backup\Notifications\Notifications\CleanupWasSuccessfulNotification::class => ['mail'], | ||
], | ||
'notifiable' => \Spatie\Backup\Notifications\Notifiable::class, | ||
'mail' => [ | ||
'to' => '[email protected]', | ||
'from' => [ | ||
'address' => env('MAIL_FROM_ADDRESS', '[email protected]'), | ||
'name' => env('MAIL_FROM_NAME', 'Example'), | ||
], | ||
], | ||
'slack' => [ | ||
'webhook_url' => '', | ||
'channel' => null, | ||
'username' => null, | ||
'icon' => null, | ||
], | ||
'discord' => [ | ||
'webhook_url' => '', | ||
'username' => '', | ||
'avatar_url' => '', | ||
], | ||
], | ||
'monitor_backups' => [ | ||
[ | ||
'name' => env('APP_NAME', 'laravel-backup'), | ||
'disks' => ['local'], | ||
'health_checks' => [ | ||
\Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1, | ||
\Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class => 5000, | ||
], | ||
], | ||
], | ||
'cleanup' => [ | ||
'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class, | ||
'default_strategy' => [ | ||
'keep_all_backups_for_days' => 7, | ||
'keep_daily_backups_for_days' => 16, | ||
'keep_weekly_backups_for_weeks' => 8, | ||
'keep_monthly_backups_for_months' => 4, | ||
'keep_yearly_backups_for_years' => 2, | ||
'delete_oldest_backups_when_using_more_megabytes_than' => 5000, | ||
], | ||
'tries' => 1, | ||
'retry_delay' => 0, | ||
], | ||
]); | ||
} | ||
|