app/Http/Middleware/UseTheme.php
private function themes(): Generator
    {
        $themes = $this->module_service->findByInterface(ModuleThemeInterface::class);

        // Last theme used
        yield $themes->get(Session::get('theme', ''));

        // Default for tree
        $tree = app(Tree::class);

        if ($tree instanceof Tree) {
            yield $themes->get($tree->getPreference('THEME_DIR'));
        }

        // Default for site
        yield $themes->get(Site::getPreference('THEME_DIR'));

        // Default for application
        yield app(WebtreesTheme::class);
    }
private function themes(): Generator
    {
        $themes = $this->module_service->findByInterface(ModuleThemeInterface::class);

        // Last theme used
        yield $themes->get(Session::get('theme', ''));

        // Default for tree
        $tree = app(Tree::class);

        if ($tree instanceof Tree) {
            yield $themes->get($tree->getPreference('THEME_DIR'));
        }

        // Default for site
        yield $themes->get(Site::getPreference('THEME_DIR'));

        // Default for application
        yield app(WebtreesTheme::class);
    }
private function themes ( ) : Generator { $ themes = $ this -> module_service -> findByInterface ( ModuleThemeInterface :: class ) ; // Last theme used yield $ themes -> get ( Session :: get ( 'theme' , '' ) ) ; // Default for tree $ tree = app ( Tree :: class ) ; if ( $ tree instanceof Tree ) { yield $ themes -> get ( $ tree -> getPreference ( 'THEME_DIR' ) ) ; } // Default for site yield $ themes -> get ( Site :: getPreference ( 'THEME_DIR' ) ) ; // Default for application yield app ( WebtreesTheme :: class ) ; }
The theme can be chosen in various ways.

@return Generator
The theme can be chosen in various ways .