app/Http/Controllers/Admin/ControlPanelController.php
private function totalNotes(): Collection
    {
        return DB::table('gedcom')
            ->leftJoin('other', static function (JoinClause $join): void {
                $join
                    ->on('o_file', '=', 'gedcom_id')
                    ->where('o_type', '=', 'NOTE');
            })
            ->groupBy('gedcom_id')
            ->pluck(DB::raw('COUNT(o_id)'), 'gedcom_id')
            ->map(static function (string $count) {
                return (int) $count;
            });
    }
private function totalNotes(): Collection
    {
        return DB::table('gedcom')
            ->leftJoin('other', static function (JoinClause $join): void {
                $join
                    ->on('o_file', '=', 'gedcom_id')
                    ->where('o_type', '=', 'NOTE');
            })
            ->groupBy('gedcom_id')
            ->pluck(DB::raw('COUNT(o_id)'), 'gedcom_id')
            ->map(static function (string $count) {
                return (int) $count;
            });
    }
private function totalNotes ( ) : Collection { return DB :: table ( 'gedcom' ) -> leftJoin ( 'other' , static function ( JoinClause $ join ) : void { $ join -> on ( 'o_file' , '=' , 'gedcom_id' ) -> where ( 'o_type' , '=' , 'NOTE' ) ; } ) -> groupBy ( 'gedcom_id' ) -> pluck ( DB :: raw ( 'COUNT(o_id)' ) , 'gedcom_id' ) -> map ( static function ( string $ count ) { return ( int ) $ count ; } ) ; }
Count the number of notes in each tree.

@return Collection
@return int[]
Count the number of notes in each tree .