mikefolu
mikefolu

Reputation: 1333

Laravel - company logo display got distorted in sub-menus

In my Laravel-5.8 application, I tried to load the company Logo from a folder into the header of the page:

<a href="{{ route('home') }}" class="brand-link logo-switch navbar-dark bg-gray-light">
  <img src="public/storage/myLogo.png" alt="MyApp" class="brand-image-xl logo-xs">
  <img src="public/storage/myLogo.png" alt="MyApp" class="brand-image-xs logo-xl" style="left: 12px">
</a>

I called it this way:

@include('layouts.partials.brand-logo')

I observed that on the main menu, the image appear well, but on the sun-menus it displays "MyApp". That is, alt

How do I resolve this?

Thanks

Upvotes: 0

Views: 86

Answers (1)

Khalid Khan
Khalid Khan

Reputation: 3185

Change your path like this to access files from public folder

<a href="{{ route('home') }}" class="brand-link logo-switch navbar-dark bg-gray-light">
  <img src="{{asset('storage/myLogo.png')}}" alt="MyApp" class="brand-image-xl logo-xs">
  <img src="{{asset('storage/myLogo.png')}}" alt="MyApp" class="brand-image-xs logo-xl" style="left: 12px">
</a>

Upvotes: 1

Related Questions