Skip to content

Commit d5b1e5f

Browse files
authored
Clear repository when extending Env (#56438)
Currently when extending `Env` with a custom adapter, the repository is not set to `null`, which can lead to the adapter not being used depending on when the adapter was registered. This fixes the issue by setting the `static::$repository` variable to `null` like the `enablePutenv()` and `disablePutenv()` methods do.
1 parent 113f194 commit d5b1e5f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Illuminate/Support/Env.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ public static function extend(Closure $callback, ?string $name = null): void
6565
} else {
6666
static::$customAdapters[] = $callback;
6767
}
68+
69+
static::$repository = null;
6870
}
6971

7072
/**

0 commit comments

Comments
 (0)