Laravel api attached volume not working
fcaceres98
HOBBYOP

9 months ago

I attached a Volume to my service #275c8ba3-ba27-4ea3-ab4d-b9ef8dfb135c name=feisty-simplicity

In the api I use php artisan storage:link and to upload images I use:

$file = $request->file('image');
$path = $file->storeAs('public/urnas/', $FileName);

The volume path is = /public/urnas/

But everytime I deploy my service all images are not loading but the volume graph shows that something was uploaded.

I dont now if Iam missing something this is the first time I use a volume on railway, thanks in advance.

Solved

10 Replies

brody
EMPLOYEE

9 months ago

@root what path is the writable path?


aleks
HOBBY

9 months ago

should be /app/storage


aleks
HOBBY

9 months ago

so thats where you should mount the volume


fcaceres98
HOBBYOP

9 months ago

This is my local proyect

1346948864892207400


aleks
HOBBY

9 months ago

Exactly, so mount the volume on railway under /app/storage - your app is in the container under /app, so any subdirectories would be under that


fcaceres98
HOBBYOP

9 months ago

I will test that right now


fcaceres98
HOBBYOP

9 months ago

Hi @root and @Brody, "/app/storage" - It worked! Thank you for the quick response.


aleks
HOBBY

9 months ago

no problem!


brody
EMPLOYEE

9 months ago

feel free to mark as solved aleks


aleks
HOBBY

9 months ago

!s


Status changed to Solved aleks 9 months ago


Loading...