Home / Snippets / How to Enable Laravel Horizon Dark Mode
How to Enable Laravel Horizon Dark Mode cover

How to Enable Laravel Horizon Dark Mode

1.4K

3 years ago

0 comments

To enable Laravel Horizon dark/night mode you can define the config from the "HorizonServiceProvider" class. Inside the "boot" method you can uncomment the "Horizon::night()" and by doing so the dark mode will be enabled by default. Do note that this night mode is available for Horizon version 3 and above.
# app/Providers/HorizonServiceProvider.php

<?php

namespace App\Providers;

use Laravel\Horizon\Horizon;
use Illuminate\Support\Facades\Gate;
use Laravel\Horizon\HorizonApplicationServiceProvider;

class HorizonServiceProvider extends HorizonApplicationServiceProvider
{
  public function boot()
  {
    parent::boot();
    Horizon::night();
  }

  /* other codes*/
}

Do note that if you recently just updated your horizon, do run the "horizon:publish" command to get the latest changes for the assets file.
php artisan horizon:publish
notion avatar

Ahabz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this