My image file path is public/img/logo.png
and
my app.blade.php file path is resources/views/app.blade.php
Inside of my app.blade.php file I use {{HTML::image('/img/stuvi-logo.png')}}
to display an image.
I don't understand why this won't find the image.
What is the root folder of the image()
method?
This question is related to
laravel
image
laravel-blade
you can Using asset() you can directly access to the image folder.
<img src="{{asset('img/stuvi-logo.png')}}" alt="logo" class="img-size-50 mr-3 img-circle">
Had the same problem with laravel 5.3... This is how I did it and very easy. for example logo in the blade page view
****<image img src="/img/logo.png" alt="Logo"></image>****
In Laravel 5.x you can use laravelcollective/html and the syntax:
{!! Html::image('img/logo.png') !!}
in my case this worked perfectly
<img style="border-radius: 50%;height: 50px;width: 80px;" src="<?php echo asset("storage/TeacherImages/{$studydata->teacher->profilePic}")?>">
this code is used to display image from folder
If you use bootstrap, you might use this -
<img src="{{URL::asset('/image/propic.png')}}" alt="profile Pic" height="200" width="200">
note: inside public folder create a new folder named image then put your images there. Using URL::asset()
you can directly access to the public folder.
In Laravel 5.x, you can also do like this .
<img class="img-responsive" src="{{URL::to('/')}}/img/stuvi-logo.png" alt=""/>
as of now, you can use
<img src="{{ asset('images/foo.png') }}" alt="tag">
Source: Stackoverflow.com