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

aschorr's avatar

Nova s3 Image link broken

I have a model that looks like the following, it's just a data model that produces an S3 image

class DrinkImage extends Model
{
    protected $fillable = [
        'filename', 'url', 'drink_id',
    ];

    public function drink()
    {
        return $this->belongsTo('App\Drink');
    }
}

And it's created with the following:

$path = $request->file('image')->store('images', 's3');
\Storage::disk('s3')->setVisibility($path, 'public');
$image = DrinkImage::create([
    'filename' => basename($path),
    'url' => \Storage::disk('s3')->url($path),
]);
$drink->image()->save($image);

The table schema looks like


| id | filename | url | drink_id |
|--|--|--|--|
| 1 | xyz | https://foo.s3.amazonaws.com/images/xyz.jpeg | 23 |

However in the nova admin dashboard the images are broken as it's trying to append my APP_URL from .env to it (APP_URL=http://localhost)

<img src="https://topofshelf.s3.amazonaws.com/https%3A//topofshelf.s3.amazonaws.com/images/xyz.jpg" class="align-bottom w-8 h-8 rounded" style="object-fit: cover;">

And you can see the misconfigured non-url encoded https%3A in the url :[

How do I tell it not to do this...?

0 likes
1 reply

Please or to participate in this conversation.