r2-dev
1 month ago
253
4
Forge

I can't retrieve files from storage

Posted 1 month ago by r2-dev

I am using Livewire to upload files and working fine. The next line do the job:

$url_photo = $this->photo->store('photos','public');

The file was saved on "storage/app/public/photos", i get that info from $url_photo. But when i try to get the file back, i get a 404 response.

$this->profile_pic = $url_photo; // the url = photos/h0njfN6ve7G2dWASdWUWgbzHgoB52CK8szM49qWl.png

in blade : img src=" / {{ $profile_pic }} "

i already did "php artisan storage:link" and remove /storage/app/public from .gitignore

Locally just add "storage " to the url and works, like this

$this->profile_pic = "storage/photos/h0njfN6ve7G2dWASdWUWgbzHgoB52CK8szM49qWl.png"

But in Production fails miserably. I am using forge to deploy to digitalOcean,

any idea? what i'm doing wrong

Please sign in or create an account to participate in this conversation.