public static function setPrimaryMenuID()
    {
        $primaryMenu = Menu::all()->where('isPrimary', 1)->first();

        //if no primary menu is found, get the first one from the list
        if (!$primaryMenu) {
            $primaryMenu = Menu::first();
        }

        if (isset($primaryMenu->menuID)) {
            self::$primaryMenuID = $primaryMenu->menuID;
        }
        return;
    }
public static function setPrimaryMenuID()
    {
        $primaryMenu = Menu::all()->where('isPrimary', 1)->first();

        //if no primary menu is found, get the first one from the list
        if (!$primaryMenu) {
            $primaryMenu = Menu::first();
        }

        if (isset($primaryMenu->menuID)) {
            self::$primaryMenuID = $primaryMenu->menuID;
        }
        return;
    }
public static function setPrimaryMenuID ( ) { $ primaryMenu = Menu :: all ( ) -> where ( 'isPrimary' , 1 ) -> first ( ) ; //if no primary menu is found, get the first one from the list if ( ! $ primaryMenu ) { $ primaryMenu = Menu :: first ( ) ; } if ( isset ( $ primaryMenu -> menuID ) ) { self :: $ primaryMenuID = $ primaryMenu -> menuID ; } return ; }
Set the ID of primary menu.

@throws \Exception
Set the ID of primary menu .