The public_path helper method returns the local file system path to your public-directory. It does not generate a URL for your asset. In this case you probably want to use the URL helper of the Storage facade:
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 ...
Please or to participate in this conversation.