php-imap
php-imap copied to clipboard
Solution for the desc order fetching records to handle in laravel
// 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',