Update BaseFileUpload.php

This commit is contained in:
Dan Harrin
2023-12-09 09:09:23 +00:00
parent 2c8dd2f37a
commit 17452b02be
@@ -188,11 +188,11 @@ class BaseFileUpload extends Field
if (
$component->shouldMoveFiles() &&
($component->getDiskName() == invade($file)->disk) /** @phpstan-ignore-line */
($component->getDiskName() == (fn (): string => $this->disk)->call($file))
) {
$newPath = trim($component->getDirectory() . '/' . $component->getUploadedFileNameForStorage($file), '/');
$component->getDisk()->move(invade($file)->path, $newPath);
$component->getDisk()->move((fn (): string => $this->path)->call($file), $newPath);
return $newPath;
}