Skip to content

Commit 2f360f2

Browse files
committed
Issue #7 Updates for Laravel 9
1 parent 6616944 commit 2f360f2

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
}
3030
},
3131
"require": {
32-
"php": ">=7.0",
33-
"consilience/flysystem-azure-file-storage": "^0.1.1"
32+
"php": ">=8.1",
33+
"consilience/flysystem-azure-file-storage": "^1.0"
3434
},
3535
"require-dev": {
36-
"phpunit/phpunit": "^6.0|^7.0",
36+
"phpunit/phpunit": "^6.0|^7.0|^9.0",
3737
"orchestra/testbench": "~3.3|~3.4|~3.5|~3.6"
3838
},
3939
"extra": {

src/ServiceProvider.php

+15-18
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
* laravel Service Provider.
77
*/
88

9-
use Storage;
109
use League\Flysystem\Filesystem;
11-
10+
use Illuminate\Filesystem\FilesystemAdapter;
1211
use Consilience\Flysystem\Azure\AzureFileAdapter;
12+
use Illuminate\Support\Facades\Storage;
1313
use MicrosoftAzure\Storage\File\FileRestProxy;
1414
use Illuminate\Support\ServiceProvider as AbstractServiceProvider;
1515

@@ -22,7 +22,7 @@ class ServiceProvider extends AbstractServiceProvider
2222

2323
/**
2424
* Bootstrap the application services.
25-
* Extend the storage filesystem withe the new driver.
25+
* Extend the storage filesystem with the new driver.
2626
*
2727
* @return void
2828
*/
@@ -46,7 +46,7 @@ public function boot()
4646
[] // $optionsWithMiddlewares
4747
);
4848

49-
$directoryPrefix = null;
49+
$directoryPrefix = '';
5050

5151
if (! empty($config['driverOptions'])) {
5252
// If a string, then treat it like a prefix for legacy support.
@@ -64,21 +64,18 @@ public function boot()
6464
$directoryPrefix = $config['root'];
6565
}
6666

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,
7372
);
74-
});
75-
}
7673

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+
});
8380
}
8481
}

0 commit comments

Comments
 (0)