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 ?
Amazon S3 supports 2 types of object URLs:
You can find more information about them here: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro
The URL you're getting from the client should work regardless of the format. The format used depends on: