Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

apocalypse's avatar

{SOLVED} Storage::url() not showing complete url from S3

I have a code to upload an image to s3, it's working fine:

$path = $request->file('logo')->store('logos'); Storage::setVisibility($path, 'public');

  $program = new Program();
    $program->name = $request->name;
    $program->logo = $path;
 $program->save();

the path saved to my db is: logo/file_hash

when I try to show the image using Storage::url($program->logo) it returns the path that it is on my DB, as if I was just using {{ $program->logo }} on blade.

I was expecting to see the full s3 path… something like: https://s3-us-west-2.amazonaws.com/BUCKETNAME//logos/AiSdRkUM5UWlpKTgif4YlWPo7AffZK0OZAYGbI5f.jpeg

Anyone knows what I'm missing here? I have a very similar code in 5.6 that works fine.

0 likes
1 reply
apocalypse's avatar
apocalypse
OP
Best Answer
Level 1

Found it!

on my .env file I was defining the AWS_URL as empty and this was overwriting the real AWS_URL.

Please or to participate in this conversation.