Skip to content

paginate() returns array of "true" #13

@Max13

Description

@Max13

I don't know if I'm not using it properly, but when I use paginate() the items are just arrays of true, while with limit() I get the messages.

Here is how I use it:

$imap = new Imap(array_merge(
    $attributes,
    [
        'password' => decrypt($this->attributes['password']),
    ],
    [
        'masks' => [
            'attachment' => \Webklex\PHPIMAP\Support\Masks\AttachmentMask::class,
            'message' => \Webklex\PHPIMAP\Support\Masks\MessageMask::class,
        ],
    ],
));
$imap->connect();

$folders = $imap->getFolders(); // Returns a correct list
$pages = $imap->getFolderByPath('folder')->messages()->all()->paginate();
$limited = $imap->getFolderByPath('folder')->messages()->all()->limit(5)->get();

So, $pages contains 5 items which are all the value true. $limited on the other hand, contains 5 Message instances which are correct.

Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions