Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom pagination not working #466

Open
Pinnokkio opened this issue Mar 12, 2023 · 1 comment
Open

Custom pagination not working #466

Pinnokkio opened this issue Mar 12, 2023 · 1 comment

Comments

@Pinnokkio
Copy link

Pinnokkio commented Mar 12, 2023

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
Copy link
Author

Any help for sorting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant