I'm using the following code to get the path of images on S3
Storage::getDriver()
->getAdapter()
->getClient()
->getObjectUrl(env('S3_BUCKET_NAME'), $key);
this url returns BUCKETNAME.s3-eu-west-1-amazon.com/$key
while the real url of the image is s3-eu-west-1-amazon.com/BUCKETNAME/$key
what to do get the same url ?