Skip to content

Commit d994dd3

Browse files
author
Fredrick Peter
committed
Data returned
1 parent 70d0ca8 commit d994dd3

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ $file->getClass();
177177
### First
178178
- This will get the first uploaded data
179179
- You can pass and [optional] param as string `name` \| `url`
180-
- Returns an array `[name, url]`
180+
- Returns an array `[name, path, url]`
181181

182182
```
183183
->save(function($response){
@@ -196,7 +196,7 @@ $upload->first('name);
196196

197197
### Get
198198
- This will get all uploaded data
199-
- Returns an index array of all uploaded data
199+
- Returns an index array of all uploaded data, `[name, path, url]`
200200

201201
```
202202
->save(function($response){

src/FileStorage.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public function handle()
107107
// replace the migrate data
108108
$migrate['urlPath'] = $save;
109109
$migrate['path'] = $fileName;
110+
$migrate['name'] = $fileName;
110111
}
111112

112113
return $migrate;

src/Methods/FileMethod.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,17 @@ static protected function getUploads($uploads, $first = false)
8686
if(self::isArray($uploads)){
8787
$uploads = $uploads[0];
8888
return [
89-
'name' => $uploads['path'],
89+
'name' => $uploads['name'],
90+
'path' => $uploads['path'],
9091
'url' => $uploads['urlPath'],
9192
];
9293
}
9394
} elseif(self::isArray($uploads)){
9495
$files = [];
9596
foreach($uploads as $key => $upload){
9697
$files[$key] = [
97-
'name' => $upload['path'],
98+
'name' => $upload['name'],
99+
'path' => $upload['path'],
98100
'url' => $upload['urlPath'],
99101
];
100102
}

0 commit comments

Comments
 (0)