Skip to content

writeMany is not overwriting existing values #29

@edalzell

Description

@edalzell

I'm trying to write to Statamic's cp.php config.

My code:

        ConfigWriter::writeMany(
            'statamic.cp',
            [
                'enabled' => env('CP_ENABLED', true),
                'route' => env('CP_ROUTE', 'cp'),
                'start_page' => 'collections/pages',
                'widgets' => [],
                'date_format' => 'Y-m-d',
                'pagination_size' => 100,
                'link_to_docs' => false,
                'support_url' => env('STATAMIC_SUPPORT_URL', 'https://www.transformstudios.com/contact'),
                'theme' => env('STATAMIC_THEME', 'simple'),
                'custom_cms_name' => env('STATAMIC_CUSTOM_CMS_NAME', env('APP_NAME', 'Simple')),
                'custom_logo_url' => [
                    'nav' => '/img/transform-studios-avatar-circle.svg',
                    'outside' => '/img/transform-studios-logo-handdrawn.svg',
                ],
                'custom_favicon_url' => '/img/favicon.ico',
                'custom_css_url' => '/css/cp.css',
                'support_url' => env('STATAMIC_SUPPORT_URL', 'https://www.transformstudios.com/contact?utm_campaign=contextual+support&utm_source=cp+support+link&utm_medium=text+link'),
            ]
        );

But the existing values in that file are not overwritten with the ones above.

It looks like the previewMany returns the existing values not the existing + merged ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions