File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 5
5
[ ![ GitHub license] ( https://img.shields.io/github/license/academe/laravel-azure-file-storage-driver.svg )] ( https://github.com/academe/laravel-azure-file-storage-driver/blob/master/LICENCE )
6
6
[ ![ GitHub issues] ( https://img.shields.io/github/issues/academe/laravel-azure-file-storage-driver.svg )] ( https://github.com/academe/laravel-azure-file-storage-driver/issues )
7
7
8
- # Microsoft Azure File Storage Filesystem Driver for Laravel 5
8
+ # Microsoft Azure File Storage Filesystem Driver for Laravel 5 and 6
9
9
10
10
This package allows Microsoft Azure File Storage
11
- to be used as a filesystem in laravel 5.
11
+ to be used as a filesystem in laravel 5 and 6 .
12
12
13
13
## Installation
14
14
@@ -55,6 +55,7 @@ Add the following to your `config/filesystems.php`:
55
55
// Optional settings
56
56
'disableRecursiveDelete' => false,
57
57
'driverOptions' => [],
58
+ 'root' => 'root/directory', // Without leading '/'
58
59
],
59
60
],
60
61
];
Original file line number Diff line number Diff line change @@ -46,15 +46,29 @@ public function boot()
46
46
[] // $optionsWithMiddlewares
47
47
);
48
48
49
- $ driverOptions = !empty ($ config ['driverOptions ' ])
50
- ? $ config ['driverOptions ' ]
51
- : null ;
49
+ $ directoryPrefix = null ;
50
+
51
+ if (! empty ($ config ['driverOptions ' ])) {
52
+ // If a string, then treat it like a prefix for legacy support.
53
+
54
+ if (is_string ($ config ['driverOptions ' ])) {
55
+ $ directoryPrefix = $ config ['driverOptions ' ];
56
+ }
57
+
58
+ if (is_array ($ config ['driverOptions ' ])) {
59
+ $ driverConfig = array_merge ($ driverConfig , $ config ['driverOptions ' ]);
60
+ }
61
+ }
62
+
63
+ if (! empty ($ config ['root ' ]) && is_string ($ config ['root ' ])) {
64
+ $ directoryPrefix = $ config ['root ' ];
65
+ }
52
66
53
67
return new Filesystem (
54
68
new AzureFileAdapter (
55
69
$ fileService ,
56
70
$ driverConfig ,
57
- $ driverOptions
71
+ $ directoryPrefix
58
72
)
59
73
);
60
74
});
You can’t perform that action at this time.
0 commit comments