Webklex / php-imap

PHP-IMAP is a wrapper for common IMAP communication without the need to have the php-imap module installed / enabled. The protocol is completely integrated and therefore supports IMAP IDLE operation and the "new" oAuth authentication process as well.
https://www.php-imap.com
MIT License
315 stars 151 forks source link

Solution for the desc order fetching records to handle in laravel #471

Open Gunasekar-Skyraan opened 9 months ago

Gunasekar-Skyraan commented 9 months ago

// Get the messages in the inbox $messages = $folder->messages()->all();

// Paginate the messages in descending order and retrieve 5 items per page $messages = $messages->setFetchOrder("desc")->paginate(5);

// Reverse the order of the paginated results without creating a new instance $messages->setCollection(collect(array_reverse($messages->items())));

to imap.php

'fetch_order' => 'desc',