I’m filtering events as shown below in which the filtering works but the sorting (by startDate) is not working. I think it’s because startDate is inside an object. How can I make this work?
$archive = page('page://YQ74DX24BOLNDBOE')
->children()
->filterBy(function ($callback) {
return $callback->generalInfo()->toObject()->startDate()->toDate('ymd') < date('ymd') && $callback->generalInfo()->toObject()->closeDate()->toDate('ymd') < date('ymd');
})
->sortBy('startDate', 'asc')