Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Nurevsan's avatar

How to display image in web site with laravel 5 ?

How to display image in web site with laravel 5 ?

0 likes
10 replies
Nurevsan's avatar

I want to add image in web site. I tried html code <img src but unviewed.

simondavies's avatar

you need to post what code your using, which view, etc else

    <img src="/img/path/to/image.jpg" />

The img folder(s) are within the public folder

Nurevsan's avatar

I tried that one but not worked. my code img src="/public/img/picture.jpeg"

simondavies's avatar

wheres you code, your image file, add a bit more details and code to help assist

You dont need the public in there. just img src="/img/picture.jpeg"

Nurevsan's avatar

My code in resources/views/tube.blade.php's body

                    <form method="link" action="http://www.tumblr.com"> 
                        <button type="submit" class="btn btn-primary" => Tumblr</button>
                      </form>
            <img src="/img/picture.jpeg" />
                    </div>
simondavies's avatar
Level 26

with in your browser console are you getting any errors, like permissions, missing image, is the file name .jpg not jpeg? An i gather your getting that view through and seeing the Tumblr button

Nurevsan's avatar

Yess, I changed jpeg to jpg . Thank you so much

o'byron's avatar

this should have worked for you <img src="{{URL::asset('directory/name_of_image_file.file_format')}}"

babind's avatar

{!!Html::Image($user->avatar)!!} {!!Html::Image('/images/Selection_121.png')!!}

Please or to participate in this conversation.