laravel-backup icon indicating copy to clipboard operation
laravel-backup copied to clipboard

excludeTables documentation wrong?

Open futzlarson opened this issue 3 years ago • 1 comments
trafficstars

Per config/backup.php:

             * The content of the database dump may be customized for each connection
             * by adding a 'dump' key to the connection settings in config/database.php.
             * E.g.
             * 'mysql' => [
             *       ...
             *      'dump' => [
             *           'excludeTables' => [
             *                'table_to_exclude_from_backup',
             *                'another_table_to_exclude'
             *            ]
             *       ],
             * ],

I have this:

            'databases' => [
                'mysql' => [
                    'dump' => [
                        'excludeTables' => [ 'sessions' ]
                    ]
                ]
            ],

But get this upon running:

Argument 1 passed to Spatie\Backup\Tasks\Backup\BackupJobFactory::Spatie\Backup\Tasks\Backup\{closure}() must be of the type string, array given, called in /var/www/production/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php on line 742

Not sure what is off there?

futzlarson avatar Aug 11 '22 02:08 futzlarson

I had a feeling I read something wrong and just noticed it's config/database.php, not config/backup.php. I didn't expect it to be in a separate file. Why not keep it all contained within the backup config?

futzlarson avatar Aug 11 '22 02:08 futzlarson

This is not a bug https://github.com/spatie/laravel-backup/blob/1aa4394e8dd619a2a2cbd480240148ace5f643f4/config/backup.php#L57 https://github.com/spatie/laravel-backup/issues/1368#issuecomment-959925953 https://github.com/spatie/laravel-backup/issues/1446#issuecomment-1013183295

PaolaRuby avatar Aug 11 '22 21:08 PaolaRuby

I know, but isn't it strange that all the backup settings are in config/backup.php, except for this one thing, which is in config/database.php? As evidenced by #1368 and #1446.

futzlarson avatar Aug 11 '22 21:08 futzlarson

Because it the best, not need to know why

PaolaRuby avatar Aug 11 '22 21:08 PaolaRuby

@futzlarson it uses another laravel package for mysql dump, that package uses default laravel database configs, there is no way to send third party configs to that package as default

Close this and read other issues or discussions before opening a new one

PaolaRuby avatar Aug 11 '22 21:08 PaolaRuby