how to retrieve image from database in laravel 5.1?
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
Related Questions
Ad
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → How do i get base url in OctoberCMS?
- → Image does not go in database with file name only tmp name saved?
- → ListView.DataSource looping data for React Native
- → how to retrieve image from database in laravel 5.1?
- → Carousel in Laravel 4 does not show as expected
- → angular ng-repeat and images in a row
- → Keeping uploaded files secure but still available via https
- → Upload file with iron-ajax (Google Polymer)
- → How can I get Greasemonkey to highlight visited image links?
- → File upload does not work Laravel
- → Populating array with items from different HTML attributes
- → Replacing background image javascript
Ad