Skip to content

Add uids() to message queries - #217

Merged
stevebauman merged 2 commits into
masterfrom
feature/message-query-uids
Nov 25, 2026
Merged

stevebauman merged 2 commits into
masterfrom
feature/message-query-uids

Conversation

@stevebauman

Copy link
Copy Markdown
Member

Sometimes you only need the UIDs of messages that match a search, for example when comparing unread messages with the IDs you’ve already imported.

uids() returns a collection of integer UIDs using the same filters, ordering, and pagination as get(). It uses the IDs from IMAP search or sort and skips fetching the messages themselves.

$uids = $mailbox->inbox()->messages()->unseen()->oldest()->uids();

Custom implementations of MessageQueryInterface need to implement uids().

@stevebauman
stevebauman merged commit 58f7a45 into master Nov 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant