aarondfrancis / fast-paginate

A fast implementation of offset/limit pagination for Laravel.
MIT License
1.21k stars 56 forks source link

Use with QueryBuilder/DB #45

Closed kieran-s closed 1 year ago

kieran-s commented 1 year ago

Is there any way to use this with the DB query builder (i.e. DB::select() ) ? Or can it only be used with eloquent?

If not, could it possibly be implemented?

aarondfrancis commented 1 year ago

Unfortunately not, as this package relies on the getting the primary key from the model, which is not possible with the base builder.

imsorx commented 7 months ago

Maybe accept a optional parameter for primary key when using caller with DB facade? PHP 8's named parameters will also make it easy.