6
6
* laravel Service Provider.
7
7
*/
8
8
9
- use Storage ;
10
9
use League \Flysystem \Filesystem ;
11
-
10
+ use Illuminate \ Filesystem \ FilesystemAdapter ;
12
11
use Consilience \Flysystem \Azure \AzureFileAdapter ;
12
+ use Illuminate \Support \Facades \Storage ;
13
13
use MicrosoftAzure \Storage \File \FileRestProxy ;
14
14
use Illuminate \Support \ServiceProvider as AbstractServiceProvider ;
15
15
@@ -22,7 +22,7 @@ class ServiceProvider extends AbstractServiceProvider
22
22
23
23
/**
24
24
* Bootstrap the application services.
25
- * Extend the storage filesystem withe the new driver.
25
+ * Extend the storage filesystem with the new driver.
26
26
*
27
27
* @return void
28
28
*/
@@ -46,7 +46,7 @@ public function boot()
46
46
[] // $optionsWithMiddlewares
47
47
);
48
48
49
- $ directoryPrefix = null ;
49
+ $ directoryPrefix = '' ;
50
50
51
51
if (! empty ($ config ['driverOptions ' ])) {
52
52
// If a string, then treat it like a prefix for legacy support.
@@ -64,21 +64,18 @@ public function boot()
64
64
$ directoryPrefix = $ config ['root ' ];
65
65
}
66
66
67
- return new Filesystem (
68
- new AzureFileAdapter (
69
- $ fileService ,
70
- $ driverConfig ,
71
- $ directoryPrefix
72
- )
67
+ $ adapter = new AzureFileAdapter (
68
+ $ fileService ,
69
+ $ config ['fileShareName ' ],
70
+ $ driverConfig ,
71
+ $ directoryPrefix ,
73
72
);
74
- });
75
- }
76
73
77
- /**
78
- * Register the application services.
79
- */
80
- public function register ()
81
- {
82
- // No services to register.
74
+ return new FilesystemAdapter (
75
+ new Filesystem ( $ adapter , $ config ),
76
+ $ adapter ,
77
+ $ config ,
78
+ );
79
+ });
83
80
}
84
81
}
0 commit comments