@@ -20,6 +20,7 @@ Laravel IMAP is an easy way to integrate the native php imap library into your *
2020 - [ Facade] ( #facade )
2121 - [ Folder / Mailbox] ( #folder--mailbox )
2222 - [ Search] ( #search-for-messages )
23+ - [ Counting messages] ( #counting-messages )
2324 - [ Result limiting] ( #result-limiting )
2425 - [ Pagination] ( #pagination )
2526 - [ View examples] ( #view-examples )
@@ -332,6 +333,19 @@ Limiting the request emails:
332333$aMessage = $oFolder->query()->since('15.03.2018')->limit(10, 2)->get();
333334```
334335
336+ #### Counting messages
337+ Count all available messages matching the current search criteria:
338+ ``` php
339+ /** @var \Webklex\IMAP\Folder $oFolder */
340+
341+ //Count all messages
342+ /** @var \Webklex\IMAP\Support\MessageCollection $aMessage */
343+ $count = $oFolder->query()->all()->count();
344+
345+ //Count all messages since march 15 2018
346+ $count = $oFolder->query()->since('15.03.2018')->count();
347+ ```
348+
335349#### Pagination
336350Paginate a query:
337351``` php
@@ -707,6 +721,7 @@ if you're just wishing a feature ;)
707721| body | string $value | WhereQuery | Select messages matching a given HTML body |
708722| before | string $value | WhereQuery | Select messages before a given date |
709723| bcc | string $value | WhereQuery | Select messages matching a given receiver (BCC:) |
724+ | count | | integer | Count all available messages matching the current search criteria |
710725| get | | MessageCollection | Fetch messages with the current query |
711726| limit | integer $limit, integer $page = 1 | WhereQuery | Limit the amount of messages being fetched |
712727| setFetchOptions | boolean $fetch_options | WhereQuery | Set the fetch options |
0 commit comments