0

I am struggling to wrap my head around the file storage in laravel. I setup the php artisan storage:link like it said to do online.

Then to store my images in my store method

$request->file('brandimage')->storeAs('/public/brandimages', $filename);

I tried doing it without the /public but it throws an error. This means when I want to delete the files I have to use

Storage::delete('public/' . $brand->brand_image_path);

(The brand_image_path is: thumbimages/thumb-post-5.jpg so it isnt adding any extra directories.

My issue is when transfer my site from local to my server none of my images show up. My project is looking for them at www.sitename.com/thumbimages/thumb-post-5.jpg but in order to actually see them I have to go to www.sitename.com/storage/thumbimages/thumb-post-5.jpg"

I'm guessing that it should work the same local as it does on the server so what part am I doing wrong?

1 Answer 1

0

I discovered that I should be using /storage/thumbimages/thumb-post-5.jpg" even when I am on local. /storage and not using /storage both work on local.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.