'mode', 'label' => 'Theme Mode', 'type' => 'select', 'options' => ['light' => 'Light', 'dark' => 'Dark'], 'default' => 'light', 'required' => true, 'validation' => 'in:light,dark', ], [ 'name' => 'local_storage_key', 'label' => 'Local Storage Key', 'type' => 'text', 'default' => '_x_darkMode', 'required' => true, 'validation' => 'string', ], ]; } public function boot() { View::prependLocation(__DIR__ . '/resources/views/overrides'); Event::listen('head', function () { $mode = $this->config('mode') ?: 'light'; $key = $this->config('local_storage_key') ?: '_x_darkMode'; $modeJs = e($mode); $keyJs = e($key); $script = ""; return ['view' => new HtmlString($script)]; }); } }