From 6e39afbf683ba06047c97f39bde4fb8262e05cf2 Mon Sep 17 00:00:00 2001 From: John Koster Date: Tue, 8 Feb 2022 19:01:34 -0600 Subject: [PATCH] Update README.md --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index 28cbf71..7bfdfe1 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,41 @@ ConfigWriter::guard('app.providers*'); ``` +## Disabling Function Rewrites + +Changes to all function calls (such as `env`) can be disabled by calling the `ignoreFunctionCalls` method before updating a configuration file: + +```php +writeMany('app', [ + 'key' => 'new-value', + 'locale' => 'fr', + 'timezone' => 'Europe/Paris' +]); +``` + +## Preserving Configuration Values + +You may ignore certain configuration value updates by using the `preserve` method. The `preserve` method accepts an array of strings (dot notation is also supported!). + +```php +writeMany('app', [ + 'locale' => 'fr', + 'timezone' => 'Europe/Paris' +]); +``` + ## Intermediate Usage For more control to remove, replace, and even merge array values with existing configuration values, we can use the `edit` helper method. This helper method expects a configuration namespace, and returns access to a convenient wrapper to perform a variety of configuration changes.