Laravel 6.2 application that displays news articles, is showing image, title, and text in a grid.
Images are uploaded in public/images/ folder and accessed using asset('images/image_name.jpg'), image name ar stored in the database.
I have added a new article and uploaded image, everything is the same as was with all other articles.
Now with the last one, there is a problem with displaying image. It shows 404 not found. Now every image I upload on server in this Laravel project public folder I can`t access anymore, shows 404 not found.
- Tried to clear Laravels cache
- Uploaded image on a server outside Laravels public folder, then I can access it.
UPDATE
Problem solved, nothing to do with Laravel.
php artisan storage:link
?asset
is using storage directory, for using it you should runstorage:link
artisan command and also you should upload images instorages/app/public/images/
- train_foxhttp://localhost:8080/images/images_name.jpg
- Doroasset('images/image_name.jpg')
toasset('/images/image_name.jpg')
add a slash before the path. Hope this helps - sta