Skip to content

Commit 656f7b7

Browse files
committed
Change approach
1 parent cb9634a commit 656f7b7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Sentry/Laravel/Features/Storage/Integration.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ function (Application $application, array $config) use ($filesystemManager): Fil
4747
unset($config['sentry_original_driver']);
4848

4949
$diskResolver = (function (string $disk, array $config) {
50-
/** @var FilesystemManager $this */
51-
return $this->resolve($disk, $config);
50+
// This is a "hack" to make sure that the original driver is resolved by the FilesystemManager
51+
$oldConfig = config("filesystems.disks.{$disk}");
52+
config(["filesystems.disks.{$disk}" => $config]);
53+
$resolved = $this->resolve($disk);
54+
config(["filesystems.disks.{$disk}" => $oldConfig]);
55+
return $resolved;
5256
})->bindTo($filesystemManager, FilesystemManager::class);
5357

5458
/** @var Filesystem $originalFilesystem */

0 commit comments

Comments
 (0)