protected function databaseConfigToBackup(array $db)
    {
        $connection = $this->getDatabaseConnectionConfig($db['source']['connection']);

        // translate laravel settings to source options
        $options = [
            'host'      => $connection['host'],
            'user'      => $connection['username'],
            'password'  => $connection['password'],
            'databases' => $connection['database'],
        ];

        // check for configuration options
        if (isset($db['source']['options'])) {
            $options = array_merge($options, $db['source']['options']);
        }

        $backup = new Configuration\Backup('db-' . $db['source']['connection'], false);
        $type   = $this->getDatabaseSourceType($connection['driver']);
        $backup->setSource(new Configuration\Backup\Source($type, $options));

        return $backup;
    }