Broken Image - Laravel 4

1

I have an image on a page, I insert it as follows:

<img src="img/logo.png">

The image usually appears on pages with address

  

/ page

. But when the URL is in the format

  

/ page / subpage

the image appears broken. How can I solve this?

    
asked by anonymous 03.11.2015 / 18:55

1 answer

3

The right thing would be for you to use a Laravel method for images.

It has two forms:

{{ HTML::image('img/logo.png') }}

Or

<img src="{{ URL::to('img/logo.png') }} />

These ways work on any page, as these methods take the public folder by default for images, scripts, and styles.

    
04.11.2015 / 11:26