Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Metronic 8.1.5 Laravel Dark mode switcher isn't displaying


Dark mode switcher is not displaying in Metronic demo 8



I didn't change anything in the code:


@if (theme()->isDarkModeEnabled())
<!--begin::Menu item-->
<div class="menu-item px-5">
<div class="menu-content px-5">
<label class="form-check form-switch form-check-custom form-check-solid pulse pulse-success" for="kt_user_menu_dark_mode_toggle">
<input class="form-check-input w-30px h-20px" type="checkbox" value="1" name="skin" id="kt_user_menu_dark_mode_toggle" {{ theme()->isDarkMode() ? "checked" : "" }} data-kt-url="{{ theme()->getPageUrl("", "", theme()->isDarkMode() ? "" : "dark") }}"/>
<span class="pulse-ring ms-n1"></span>

<span class="form-check-label text-gray-600 fs-7">
{{ __("Dark Mode") }}
</span>
</label>
</div>
</div>
<!--end::Menu item-->
@endif


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Hi

I also found this out.
In the file "config/global/general.php" add


"main" => [
"dark-mode-enabled" => true
]


to the "layout" array



Hi DevMushref,

Please check this file views/partials/topbar/_user-menu.blade.php

There is a sample code for the dark mode switcher which is located on the topbar.

Thanks


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(