Posts Learn Components new Snippets new Categories Tags About
/

How to Enable Laravel Horizon Dark Mode

Learn how to enable Laravel horizon dark/night mode for better accessibility

Created on Jul 20, 2021

87 views

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
new

If you like our tutorial, do make sure to support us with some coffee. We need the juice to write the content during the night 🤙🏻