src/includes/traits/Facades/App.php
public static function appParent(int $levels = 1)
    {
        $levels        = max(1, $levels);
        $level_counter = 1; // Start from `1`.
        $Parent        = $GLOBALS[static::class]->Parent;

        while ($Parent && $level_counter < $levels) {
            $Parent = $Parent->Parent ?? null;
            ++$level_counter; // Counter.
        }
        return $Parent; // Possible `null`.
    }
public static function appParent(int $levels = 1)
    {
        $levels        = max(1, $levels);
        $level_counter = 1; // Start from `1`.
        $Parent        = $GLOBALS[static::class]->Parent;

        while ($Parent && $level_counter < $levels) {
            $Parent = $Parent->Parent ?? null;
            ++$level_counter; // Counter.
        }
        return $Parent; // Possible `null`.
    }
@since 160715 App parent.

@param int $levels Up X levels.

@return Classes\App|null Parent App; else `null`.