app/Statistics/Repository/IndividualRepository.php
private function totalLivingQuery(): int
    {
        $query = DB::table('individuals')
            ->where('i_file', '=', $this->tree->id());

        foreach (Gedcom::DEATH_EVENTS as $death_event) {
            $query->where('i_gedcom', 'NOT LIKE', "%\n1 " . $death_event . '%');
        }

        return $query->count();
    }
private function totalLivingQuery(): int
    {
        $query = DB::table('individuals')
            ->where('i_file', '=', $this->tree->id());

        foreach (Gedcom::DEATH_EVENTS as $death_event) {
            $query->where('i_gedcom', 'NOT LIKE', "%\n1 " . $death_event . '%');
        }

        return $query->count();
    }
private function totalLivingQuery ( ) : int { $ query = DB :: table ( 'individuals' ) -> where ( 'i_file' , '=' , $ this -> tree -> id ( ) ) ; foreach ( Gedcom :: DEATH_EVENTS as $ death_event ) { $ query -> where ( 'i_gedcom' , 'NOT LIKE' , "%\n1 " . $ death_event . '%' ) ; } return $ query -> count ( ) ; }
Count the number of living individuals.

The totalLiving/totalDeceased queries assume that every dead person will
have a DEAT record. It will not include individuals who were born more
than MAX_ALIVE_AGE years ago, and who have no DEAT record.
A good reason to run the “Add missing DEAT records” batch-update!

@return int
Count the number of living individuals .