Skip to content
This repository was archived by the owner on Sep 1, 2021. It is now read-only.

Commit b7e0e34

Browse files
Merge pull request #2 from lukepolo/patch-2
Making items of adapter optional
2 parents 009e5f2 + a37e938 commit b7e0e34

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/SFTPServiceProvider.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,19 @@ class SFTPServiceProvider extends ServiceProvider
1717
public function boot()
1818
{
1919
Storage::extend('sftp', function ($app, $config) {
20+
21+
$config = collect($config);
22+
2023
return new Filesystem(new SftpAdapter([
2124
'host' => $config['host'],
2225
'port' => $config['port'],
2326
'username' => $config['username'],
2427
'password' => $config['password'],
25-
'privateKey' => $config['private_key'],
26-
'root' => $config['root'],
27-
'timeout' => $config['timeout'],
28+
'privateKey' => $config->get('private_key'),
29+
'root' => $config->get('root'),
30+
'timeout' => $config->get('timeout', 30),
2831
]));
32+
2933
});
3034
}
3135

0 commit comments

Comments
 (0)