aldrumo/theme-manager

Laravel based Theme manager for your application

0.5.0 2022-08-28 13:48 UTC

This package is auto-updated.

Last update: 2024-10-28 19:13:51 UTC


README

A laravel theme package

ThemeManager

    $themeCollection = resolve(\Aldrumo\ThemeManager\ThemeManager::class)->availableThemes();
    resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme('ThemeName');
    // throws \Aldrumo\ThemeManager\Exceptions\ActiveThemeNotSetException
    resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme();
    // throws \Aldrumo\ThemeManager\Exceptions\ThemeNotFoundException
    resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme('MissingTheme');
    resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme('ThemeName');

    $themeBase = resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme();
    // runs uninstall on OldTheme ThemeBase file
    // runs install on NewTheme ThemeBase file
    // runs activeTheme for NewTheme  
    resolve(\Aldrumo\ThemeManager\ThemeManager::class)->installTheme('NewTheme', 'OldTheme');

ThemeBase

    $themeBase = resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme();

    $viewsCollection = $themeBase->availableViews();
    $themeBase = resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme();

    $themeBase->install();
    $themeBase->uninstall();