Hi , everyone.
$sql = "SELECT *,earth_distance(ll_to_earth(team.lat, team.lng), ll_to_earth(23.1215939329,113.3096030895)) AS distance FROM team where earth_box(ll_to_earth(23.1215939329,113.3096030895),1000) @> ll_to_earth(team.lat, team.lng); ";
$result = DB::select( \DB::raw( $sql ) );
This is my Controller code, My question is , how can i use Pagination add into this code to build my restful api ?
The second question , iOS or android will send the "next page" parameter , how to use it and find the next section data ?
If you know how to do it or any open resource in use , please tell me , thanks!!!
Think of Creating A Paginator Manually when using raw SQL.
Another related useful resources on Stackoverflow:
Some API centric Github relevant repositories:
See this thread, has another paginator example ===http://laravel.io/forum/11-13-2014-laravel-5-pagination
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community