Skip to content

Commit ee717ad

Browse files
committed
fix disk attribute
1 parent ce09631 commit ee717ad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Upload.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public static function upload(UploadedFile $file, array $options = [])
5555
{
5656
$originalOptions = array_merge(config('Pharaonic.uploader.options', []), $options);
5757
$options = (object) $originalOptions;
58-
59-
$disk = $options['disk'] ?? config('Pharaonic.uploader.disk', 'public');
58+
59+
$disk = $options->disk ?? config('Pharaonic.uploader.disk', 'public');
6060
$name = $file->getClientOriginalName();
6161
$hash = $file->hashName();
6262
if (strpos($hash, '.') !== false) {
@@ -134,6 +134,7 @@ public static function upload(UploadedFile $file, array $options = [])
134134
'name' => $name,
135135
'hash' => $hash,
136136
'path' => $path . DIRECTORY_SEPARATOR . $hash . $plusName,
137+
'disk' => $disk,
137138
'extension' => $extension,
138139
'mime' => $mime,
139140
'size' => $size,
@@ -148,6 +149,7 @@ public static function upload(UploadedFile $file, array $options = [])
148149
'name' => $name,
149150
'hash' => $hash,
150151
'path' => $path . DIRECTORY_SEPARATOR . $hash . $plusName,
152+
'disk' => $disk,
151153
'extension' => $extension,
152154
'mime' => $mime,
153155
'size' => $size,

0 commit comments

Comments
 (0)