Laravel图像问题

时间:2015-11-14 18:29:40

标签: html laravel laravel-5 laravel-5.1

即时尝试为我的用户制作个人资料视图,但在显示个人资料照片时遇到问题,因为我得到的框就像是在等待照片,但它没有显示它,这里是代码:

@include(' layouts.header') @include(' layouts.navbar&#39)

<div class="media-body">
    <a class="pull-left">
    <img class="media-object" src="{{Auth::user()->avatar}}" alt = "Foto de perfil">
    </a>
    <h3>{{Auth::user()->name}}</h3><br>
    <h5>Email: {{Auth::user()->email}}</h5>
    <h5>Telefono: {{Auth::user()->phone}}</h5>
</div>


@include('layouts.footer')

我将图像保存在public / images /

1 个答案:

答案 0 :(得分:1)

你可以试试这个(假设Auth::user()->avatar只返回文件名,如 - image.png):

<img
class="media-object"
src="{{asset('images') . '/' . Auth::user()->avatar }}"
alt = "Foto de perfil"
/>