Webklex / laravel-imap

Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app.
https://www.php-imap.com
MIT License
629 stars 179 forks source link

Custom pagination not working #466

Open Pinnokkio opened 1 year ago

Pinnokkio commented 1 year ago

In other projects, I'm using $this->app->alias(CustomPaginator::class, LengthAwarePaginator::class); in AppServiceProvider#register to use a custom pagination when using

$users = $query->orderBy('lastname')->orderBy('firstname')->orderBy('id')->paginate(
    perPage: $request->validated('per_page') ?: 15,
    page: $request->validated('page') ?: 1
); 

For some reason, it doesn't work using the following pagination method: $messagePreviews = $targetFolder->query()->all()->paginate(15);, it's always LengthAwarePaginator. Any ideas why?

And how do I deep sort folders alphabetically ascending by name? Everytime I use sortBy on getFolders, it only sorts the first level.

Also, I'm not really sure if this is the right way to a folder preview. The documentation is not really expressive for me I think. Thank you.

By the way, your discord link does not work anymore.

Pinnokkio commented 1 year ago

Any help for sorting?