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

Commit d14f901

Browse files
authored
add Laravel S3 region support (#715)
1 parent dd27f17 commit d14f901

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/AsyncAwsFilesystemManager.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ public function createAsyncAwsS3Driver(array $config)
2828
$s3Config['endpoint'] = $config['endpoint'];
2929
}
3030

31+
if (!empty($config['region'])) {
32+
$s3Config['region'] = $config['region'];
33+
}
34+
3135
$root = $config['root'] ?? '';
3236
$options = $config['options'] ?? [];
3337

tests/Unit/ServiceProviderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function testCreateFilesystem()
2727
'key' => 'my_key',
2828
'secret' => 'my_secret',
2929
'bucket' => 'my_bucket',
30+
'region' => 'ap-southeast-1',
3031
]);
3132

3233
self::assertInstanceOf(FilesystemAdapter::class, $illuminateFilesystemAdapter);
@@ -49,5 +50,6 @@ public function testCreateFilesystem()
4950
$config = $client->getConfiguration();
5051
self::assertEquals('my_key', $config->get('accessKeyId'));
5152
self::assertEquals('my_secret', $config->get('accessKeySecret'));
53+
self::assertEquals('ap-southeast-1', $config->get('region'));
5254
}
5355
}

0 commit comments

Comments
 (0)