app/Statistics/Repository/IndividualRepository.php
private function totalIndisWithSourcesQuery(): int
    {
        return DB::table('individuals')
            ->select(['i_id'])
            ->distinct()
            ->join('link', static function (JoinClause $join): void {
                $join->on('i_id', '=', 'l_from')
                    ->on('i_file', '=', 'l_file');
            })
            ->where('l_file', '=', $this->tree->id())
            ->where('l_type', '=', 'SOUR')
            ->count('i_id');
    }
private function totalIndisWithSourcesQuery(): int
    {
        return DB::table('individuals')
            ->select(['i_id'])
            ->distinct()
            ->join('link', static function (JoinClause $join): void {
                $join->on('i_id', '=', 'l_from')
                    ->on('i_file', '=', 'l_file');
            })
            ->where('l_file', '=', $this->tree->id())
            ->where('l_type', '=', 'SOUR')
            ->count('i_id');
    }
private function totalIndisWithSourcesQuery ( ) : int { return DB :: table ( 'individuals' ) -> select ( [ 'i_id' ] ) -> distinct ( ) -> join ( 'link' , static function ( JoinClause $ join ) : void { $ join -> on ( 'i_id' , '=' , 'l_from' ) -> on ( 'i_file' , '=' , 'l_file' ) ; } ) -> where ( 'l_file' , '=' , $ this -> tree -> id ( ) ) -> where ( 'l_type' , '=' , 'SOUR' ) -> count ( 'i_id' ) ; }
How many individuals have one or more sources.

@return int
How many individuals have one or more sources .