The photos in Laravel 8 are not showing in html "the alternative text is showing instead". In windows file explorer, I found each photo as a folder with the name of the photo for example "myphoto.jpg" and inside this folder there is a ".tmp" file. the destination folder is "uploads/posts" and when I inspect the photo in the browser, the link is shown correctly. here's a link example of one photo: "http://localhost/laravel/blog/uploads/posts/1657160399photo.jpg".
and when I access it directly from the browser, I get "404 Not Found". I tried to add the following code inside filesystems.php inside "links" but it didn't work as well, the code line is:
public_path('uploads/posts') => storage_path('app/uploads/posts')
and in the terminal I also executed the following command but to no avail:
php artisan storage:link
I'll put below some related code from filesystems.php:
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
and
'links' => [
public_path('storage') => storage_path('app/public'),
//added by me
public_path('uploads/posts') => storage_path('app/uploads/posts')
],
and one last note .. I used .htaccess in my root folder just to get rid of "public" from the link.. for example if I want to go to posts page I write :
http://localhost/laravel/blog/posts
insted of: http://localhost/laravel/blog/public/posts
Thanks in advance.