diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php index 2dfe11f00ce7..30a4f8424c09 100644 --- a/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -276,7 +276,9 @@ public function url($path) { $adapter = $this->driver->getAdapter(); - if ($adapter instanceof AwsS3Adapter) { + if (method_exists($adapter, 'getUrl')) { + return $adapter->getUrl($path); + } elseif ($adapter instanceof AwsS3Adapter) { $path = $adapter->getPathPrefix().$path; return $adapter->getClient()->getObjectUrl($adapter->getBucket(), $path); @@ -284,8 +286,6 @@ public function url($path) $path = '/storage/'.$path; return Str::contains($path, '/storage/public') ? Str::replaceFirst('/public', '', $path) : $path; - } elseif (method_exists($adapter, 'getUrl')) { - return $adapter->getUrl($path); } else { throw new RuntimeException('This driver does not support retrieving URLs.'); }