how to retrieve image from database in laravel 5.1?

- 1 answer

Ad

I have image name in the database and image upload in public/image folder.

Now I want to show the image on the web page.

How do I do this?

I am using

<img src="{{ URL::to('/') }}/images/{{ $item->Photo }}" alt="{{ $item->Title }}"/>
Ad

Answer

Ad

You can use the asset() helper function, like so:

<img src="{{ asset("images/$item->Photo") }}" alt="{{ $item->Title }}" >
Ad
source: stackoverflow.com
Ad