public function setActiveTheme($themeName = '')
    {
        Event::fire('theme.before_is_set', [$this]);

        if($themeName) {
            if(!self::ifExists($themeName)) {
                throw new \Exception($themeName . ' Theme  could not be found in file directory.');
            }
        }else{
            // return mobile theme if site is accessed from mobile or tablet
            if(settings('activateMobileTheme') && (MobileDetect::isMobile() || MobileDetect::isTablet()) ) {
                $themeName = settings('mobileActiveTheme');
            }else {
                // Theme from settings
                $themeName = settings('activeTheme');

                // Or return default theme of no theme is selected in settings
                if (!$themeName) {
                    $themeName = config('project.defaultTheme');
                }
            }
        }

        // Ensure theme exist
        if(!self::ifExists($themeName)) {
            throw new \Exception("Theme '$themeName' does not exist in Themes directory!");
        }

        self::$activeTheme = $themeName;

        $this->setConfig();

        Event::fire('theme.after_is_set', [$this]);
    }
public function setActiveTheme($themeName = '')
    {
        Event::fire('theme.before_is_set', [$this]);

        if($themeName) {
            if(!self::ifExists($themeName)) {
                throw new \Exception($themeName . ' Theme  could not be found in file directory.');
            }
        }else{
            // return mobile theme if site is accessed from mobile or tablet
            if(settings('activateMobileTheme') && (MobileDetect::isMobile() || MobileDetect::isTablet()) ) {
                $themeName = settings('mobileActiveTheme');
            }else {
                // Theme from settings
                $themeName = settings('activeTheme');

                // Or return default theme of no theme is selected in settings
                if (!$themeName) {
                    $themeName = config('project.defaultTheme');
                }
            }
        }

        // Ensure theme exist
        if(!self::ifExists($themeName)) {
            throw new \Exception("Theme '$themeName' does not exist in Themes directory!");
        }

        self::$activeTheme = $themeName;

        $this->setConfig();

        Event::fire('theme.after_is_set', [$this]);
    }
public function setActiveTheme ( $ themeName = '' ) { Event :: fire ( 'theme.before_is_set' , [ $ this ] ) ; if ( $ themeName ) { if ( ! self :: ifExists ( $ themeName ) ) { throw new \ Exception ( $ themeName . ' Theme  could not be found in file directory.' ) ; } } else { // return mobile theme if site is accessed from mobile or tablet if ( settings ( 'activateMobileTheme' ) && ( MobileDetect :: isMobile ( ) || MobileDetect :: isTablet ( ) ) ) { $ themeName = settings ( 'mobileActiveTheme' ) ; } else { // Theme from settings $ themeName = settings ( 'activeTheme' ) ; // Or return default theme of no theme is selected in settings if ( ! $ themeName ) { $ themeName = config ( 'project.defaultTheme' ) ; } } } // Ensure theme exist if ( ! self :: ifExists ( $ themeName ) ) { throw new \ Exception ( "Theme '$themeName' does not exist in Themes directory!" ) ; } self :: $ activeTheme = $ themeName ; $ this -> setConfig ( ) ; Event :: fire ( 'theme.after_is_set' , [ $ this ] ) ; }
Get active theme.

@param  string $themeName
@throws \Exception
Get active theme .