1

I using ajax get the data and append to html in my div, the code likes..

var r = jQuery.parseJSON(JSON.stringify(data));
var append =  '<img src="{{ asset('storage/app/item') }}/' + r.image+'">';

And the image url getting an error path message

http://www.example.com/storage/app/item/item-1.jpg

NotFoundHttpException in RouteCollection.php line 161:

What the problem is? How can I get the right url?

Fan
  • 1,124
  • 3
  • 17
  • 35

1 Answers1

0

Your image are on the storage and you only have access to the public folder, because of that, you need to create a symlink to make it accessible

ln -s /path/to/laravel/storage/app/item /path/to/laravel/public/item

Now you can use the asset in your view and retrieve the image

{{ asset('app/item') }}

Similar topic here

Community
  • 1
  • 1
João Mantovani
  • 2,230
  • 1
  • 21
  • 33