Search code examples
laravelvue.jsserverstoragelocal

I save image in storage/app/public why when I run website on server image not show


I save image in storage/app/public when I run the website on localhost, I can see my image but when I run the website in server image not show. It says '404 (Not Found)'

Um... When I run my website on localhost image will save to public/storage but in server I have only public_html and image don't save on public_html/storage

I use laravel for backend and vue for frontend

I try to connect SSH access enter image description here


Solution

  • Run the following command on your server:

    php artisan storage:link 
    
    

    This command will create a symlink of your storage in public folder. As laravel app's only public folder is publicly accessible, so it can read data from public/storage