app/Module/FamilyTreeFavoritesModule.php
public function getFavorites(Tree $tree): array
    {
        return DB::table('favorite')
            ->where('gedcom_id', '=', $tree->id())
            ->whereNull('user_id')
            ->get()
            ->map(static function (stdClass $row) use ($tree): stdClass {
                if ($row->xref !== null) {
                    $row->record = GedcomRecord::getInstance($row->xref, $tree);
                } else {
                    $row->record = null;
                }

                return $row;
            })
            ->all();
    }
public function getFavorites(Tree $tree): array
    {
        return DB::table('favorite')
            ->where('gedcom_id', '=', $tree->id())
            ->whereNull('user_id')
            ->get()
            ->map(static function (stdClass $row) use ($tree): stdClass {
                if ($row->xref !== null) {
                    $row->record = GedcomRecord::getInstance($row->xref, $tree);
                } else {
                    $row->record = null;
                }

                return $row;
            })
            ->all();
    }
public function getFavorites ( Tree $ tree ) : array { return DB :: table ( 'favorite' ) -> where ( 'gedcom_id' , '=' , $ tree -> id ( ) ) -> whereNull ( 'user_id' ) -> get ( ) -> map ( static function ( stdClass $ row ) use ( $ tree ) : stdClass { if ( $ row -> xref !== null ) { $ row -> record = GedcomRecord :: getInstance ( $ row -> xref , $ tree ) ; } else { $ row -> record = null ; } return $ row ; } ) -> all ( ) ; }
Get the favorites for a family tree

@param Tree $tree

@return stdClass[]
Get the favorites for a family tree