Open mho22 opened 4 months ago
I suggest to update your own config file when upgrading to a new major, so they keep in sync.
https://github.com/spatie/laravel-backup/blob/main/config/backup.php
Hi @Nielsvanpach,
This isn't really an "issue"—it's more of a suggestion. As you know it, in Laravel 11, when developers don't need to change the default values in a config file, it's not necessary to include those defaults in the project's config.
In Laravel Backup 8 with Laravel 11, if I wanted to modify just the backup.name
, I could do so with a minimal config file :
config/backup.php
<?php
return [
'backup' => [
'name' => "Foo",
],
];
However, in Laravel Backup 9 with Laravel 11, to modify the backup.name
, I have to include additional mandatory elements :
config/backup.php
<?php
return [
'backup' => [
'name' => "Foo",
'source' => [
'files' => [
'include' => [
base_path(),
],
'exclude' => [
base_path('vendor'),
base_path('node_modules'),
],
'relative_path' => null,
],
'databases' => [
'mysql',
],
],
'database_dump_filename_base' => 'database',
'database_dump_file_extension' => '',
'destination' => [
'compression_method' => ZipArchive::CM_DEFAULT,
'compression_level' => 9,
],
'password' => env('BACKUP_ARCHIVE_PASSWORD'),
'encryption' => 'default',
'tries' => 1,
'retry_delay' => 0,
],
];
Even though the rest of these properties are just defaults from the original laravel-backup/config/backup.php
.
My suggestion is to allow the config/backup.php
file to remain "clean," including only the configurations that need to be changed, rather than copying the entire file. I wanted to clarify this point before getting your thoughts on it.
With version
9.0.0
a lot of config values become mandatory in config file. In my case in previous version8.8.1
I didn't need these properties :Should this be a good idea to merge arrays with default config inside
Config::fromArray
insrc/Config/Config.php
file on line24
:This is probably a bit tricky, but the idea to merge missing elements from default config into the current one should probably be the solution ?