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

peterhrobar's avatar

public/storage path is not readable from blade view

I have a filament 3.x application which allows the users to upload images of various products.

I'm using a public filesystem driver like this:

'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
            'throw' => false,
        ],

I have a mail template that is embedding the product images using a blade view like this:

<img src="{{ $message->embed(public_path().'/storage/'.$configuration->starter->image) }}">

Images are uploaded to their corresponding sub-directories based on their product category.

On the development server everything works as expected (e.g. thumbnail images, "normal" images, image editor, mail template).

On the production server the website is showing the thumbnail images and the "normal" images on the Filament resource page just fine. I can even get the image of the products using their direct URL, however the mail template is not working.

All I got is:

Path "/home/forge/<project name>/public/storage/" is not readable.

I have symlinked the directories with

php artisan storage:link

I have double checked the permissions as well.

The site is running under NGINX ...

0 likes
3 replies
Snapey's avatar

in your mail template, use the storage facade to generate your url

<img src="{{ Storage::disk('public')->url($configuration->starter->image) }}">

Then if you change the storage config, the URL will be automatically correct.

peterhrobar's avatar

Turned out that the image property was null and the embed method tried to embed the directory itself. For obvious reasons it failed to do so .... as of now i just put it inside an if statement

Please or to participate in this conversation.