Laravel Blade html image

后端 未结 8 1456
旧巷少年郎
旧巷少年郎 2020-12-18 18:33

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 fi

相关标签:
8条回答
  • 2020-12-18 19:03

    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">
    
    0 讨论(0)
  • 2020-12-18 19:07

    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.

    0 讨论(0)
  • 2020-12-18 19:12

    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>****
    
    0 讨论(0)
  • 2020-12-18 19:12

    In Laravel 5.x, you can also do like this .

    <img class="img-responsive" src="{{URL::to('/')}}/img/stuvi-logo.png" alt=""/>

    0 讨论(0)
  • 2020-12-18 19:14

    as of now, you can use

    <img src="{{ asset('images/foo.png') }}" alt="tag">
    
    0 讨论(0)
  • 2020-12-18 19:19

    In Laravel 5.x you can use laravelcollective/html and the syntax:

    {!! Html::image('img/logo.png') !!}
    
    0 讨论(0)
提交回复
热议问题