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

Geofence does not work with pagination #17

Open
Ruitjes opened this issue Jul 19, 2019 · 2 comments
Open

Geofence does not work with pagination #17

Ruitjes opened this issue Jul 19, 2019 · 2 comments

Comments

@Ruitjes
Copy link

Ruitjes commented Jul 19, 2019

Laravel Framework 5.8.14
PHP 7.2.11
10.2.10-MariaDB

 $ads = Ads::geofence($json->lat, $json->lon, 0, $distance);
 $ads = $ads->Paginate(25);

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'distance' in 'having clause' (SQL: select count(*) as aggregate from ads having distance BETWEEN 0 AND 99999999)

@Ruitjes
Copy link
Author

Ruitjes commented Jul 24, 2019

It will work with simplePagination.
But its not ideal in my case..

@mattiusclay
Copy link

Just to let others know there is a package which allows you to paginate with the "having" clause.

https://github.com/justbetter/laravel-pagination-with-havings

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

2 participants