Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 868771a

Browse files
committed
edit README file
1 parent aff3c26 commit 868771a

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ return [
3636
"secret" => "ashkdsjka#sdkdjfsj22188455$$#$%dsDFsdf",
3737
"download_link_expire" => 160, // minutes
3838
],
39-
// we add another types
40-
// "image" => [
41-
// //
42-
// ],
39+
"image" => [
40+
"provider" => \AliGhale\FileManager\Types\Image::class,
41+
"path" => "images/upload/documents/",
42+
"sizes" => ["16", "24", "32", "64", "128", "320"],
43+
"thumb" => "320"
44+
],
45+
"profile" => [
46+
"parent" => "image",
47+
"path" => "images/upload/profiles/",
48+
"date_time_prefix" => false,
49+
],
4350
],
4451
];
4552
```
@@ -56,7 +63,9 @@ return [
5663
|use_file_name_to_upload| `boolean`| if is `true` we use of the file original name else we generate a random name|
5764
|secret |`string` | secret key for generate download link and download file|
5865
|download_link_expire|`boolean`|generated download link expire time|
59-
66+
|parent |`string` |parent type name |
67+
|sizes |`array` |array of sizes and there are only for image type|
68+
|thumb |`string` or `number`|size for thumb image and this is only for image type|
6069

6170

6271
## Lets start to use:
@@ -78,6 +87,7 @@ $fileName = $upload->getName();
7887
| method |description |
7988
|--------------------------------------|---------------------------------------------|
8089
| `useFileNameToUpload($status = true)`|if is `true` we use of the file original name else we generate a random name|
90+
|`type($type = null)` |change type for upload if is null so use of default type|
8191
|`getFile($name = null)` |get file by name and return a `\AliGhale\FileManager\Models\File`|
8292
| `setPath($path)` |set file upload path |
8393
| `getUploadPath()` |get upload path |
@@ -91,7 +101,7 @@ $fileName = $upload->getName();
91101
### Examples:
92102
```php
93103
$file = request()->file('filename');
94-
$upload = File::setName('your specific name')
104+
$upload = \AliGhale\FileManager\Facades\File::setName('your specific name')
95105
->isPrivate()
96106
->setFormat('png')
97107
->dateTimePrefix()
@@ -111,3 +121,10 @@ $file->generateLink();
111121
// return response download
112122
// $file->download();
113123
```
124+
125+
### Change type:
126+
```php
127+
$file = request()->file('filename');
128+
$upload = \AliGhale\FileManager\Facades\File::type("type_name") // type name in config file (filemanager.php)
129+
->upload($file);
130+
```

0 commit comments

Comments
 (0)