Custom pagination not working
Pinnokkio opened this issue · 1 comments
Pinnokkio commented
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
Any help for sorting?