I have encountered a lot of difficulty whilst getting images to display on a localhost server using Laravel 4.2.6 in a Blade Template View.
My image: 'logo.png' has been stored in the laravel\public\ folder for simplicity (laravel\public\logo.png).
I have a 'base.blade.php' view stored in app\views\layouts.
<body>
<p> Image goes here
{{ HTML::image('logo.png', 'logo') }}
<img src="{{ asset('logo.png') }}" alt="logo" />
</p>
@yield('body')
</body>
Neither of the above methods for displaying the image have worked. Rather they display a broken image icon.
I thought adding an initial '/' to the route may help point to the root directory, but this hasn't helped either:
{{ HTML::image('/logo.png', 'logo') }}
<img src="{{ asset('/logo.png') }}" alt="logo" />
I initially tried storing the image as public/assets/images/logo.png, but changed the directory to simplify the problem when encountering errors.
I can't see a reason for this not to work. I am new to using Laravel, but have searched thoroughly and found no other solutions than those above. I have considered that perhaps I have some configuration wrong in WAMP, the rewrite_module is in use however. Do I need to declare an asset in routes before I use it? Is there something in the Laravel configuration I need to change?
Any help would be greatly appreciated!