File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ public function streamDecrypt($sourceFile)
164164 protected function getFilePath ($ file )
165165 {
166166 if ($ this ->isS3File ()) {
167- return "s3:// {$ this ->adapter -> getBucket ()}/ {$ file }" ;
167+ return "s3:// {$ this ->getBucket ()}/ {$ file }" ;
168168 }
169169
170170 return Storage::disk ($ this ->disk )->path ($ file );
@@ -175,6 +175,11 @@ protected function isS3File()
175175 return $ this ->disk == 's3 ' ;
176176 }
177177
178+ protected function getBucket ()
179+ {
180+ return config ('filesystems.disks.s3.bucket ' );
181+ }
182+
178183 protected function setAdapter ()
179184 {
180185 if ($ this ->adapter ) {
@@ -189,7 +194,17 @@ protected function registerServices()
189194 $ this ->setAdapter ();
190195
191196 if ($ this ->isS3File ()) {
192- $ client = $ this ->adapter ->getClient ();
197+
198+ $ adapter = $ this ->adapter ;
199+
200+ if (is_a ($ adapter , 'League\Flysystem\AwsS3V3\AwsS3V3Adapter ' )) {
201+ // Flysystem v3 changed the way to retrieve the client
202+ $ client = Storage::disk ($ this ->disk )->getClient ();
203+ } else {
204+ $ client = $ this ->adapter ->getClient ();
205+
206+ }
207+
193208 $ client ->registerStreamWrapper ();
194209 }
195210 }
You can’t perform that action at this time.
0 commit comments