Hello there,
How can I filterBy a field being empty ?
As in
filter by startdate equals today AND enddate empty
Thank you
Hello there,
How can I filterBy a field being empty ?
As in
filter by startdate equals today AND enddate empty
Thank you
This should work:
$filtered = $page
->children()
->filter(function ($child) {
return $child->startdate()->toDate('Y-m-d) === date('Y-m-d) && $child->enddate()->isEmpty();
});
Ok, thank you, yes.
My question was more about filterBy being able to do it, but I assume your suggestion means it can’t.
Thank you!