Skip to content

Commit cd2911b

Browse files
author
Fredrick Peter
committed
minor update
1 parent d994dd3 commit cd2911b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function save(callable $function = null)
9999

100100
if($this->success){
101101
if(empty($this->folder)){
102-
$this->folder = 'public/images';
102+
$this->folder = 'images';
103103
}
104104

105105
$this->proceedToSave()

src/Traits/FileStorageTrait.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ protected function createParentFolder($uploadDirectory)
7373

7474
// loop through each directory path
7575
foreach($directorySegments as $key => $segment){
76-
77-
$segmentPath .= '/' . $segment;
76+
77+
$separator = $key === 0 ? '' : '/';
78+
$segmentPath .= $separator . $segment;
7879

7980
// create absolute path
8081
$fullPath = "{$this->config['baseDir']}{$segmentPath}";

src/Traits/FileTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function globalConfig($message = [], $config = [], $class = [])
7676
'size' => 2097152, // 2mb
7777
'mime' => 'images', // video|audio|files|images|general_image|general_media|general_file
7878
'baseUrl' => domain(),
79-
'baseDir' => base_path(),
79+
'baseDir' => base_path('public'),
8080
'driver' => 'local', // local|s3
8181
'structure' => 'default', // default|year|month|day
8282
'generate' => true, // will always generate a unique() name for each uploaded file

0 commit comments

Comments
 (0)