0
votes

I want to retrieve image form database in laravel. I upload the image file into storage/public/images folder. For fetching image i create a link between storage and main public folder. When we execute php artisan storage:link command the storage folder is linked but the link storage folder create a shortcut. For this shortcut problem i can not retrieve data. how can i link storage folder to the public folder without creating shorcut.

@foreach ($data as $value)
       <tr>
            <td>{{$value->id}}</td>
              <td>{{$value->product_name}}</td>
              <td>{{$value->produt_catecory}}</td>
               <td><img src = "{{Storage::url($value->product_image)}}" 
               style="height: 50px; width: 50px;" /></td>
               <td>{{$value->description}}</td>
              </tr>
@endforeach
1
I suggest you to create a method which returns your base64 encoded image and then set its route to the img's tag src, this way you even don't need any folder link and you can keep your images directory privateLeonardo Gasparini
When you say shortcut are you referring to the symlink or something else?Rwd

1 Answers

0
votes

Assume your problem is windows creating a shortcut instead of symlink to the storage folder.

I found this discussions on laracasts:

https://laracasts.com/discuss/channels/laravel/storage-and-symbolic-links

which links to this article on how to create symlinks on windows.

https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/