Skip to content

Instantly share code, notes, and snippets.

@YOzaz
Created November 17, 2014 12:46
Show Gist options
  • Save YOzaz/1055381354a9e092c605 to your computer and use it in GitHub Desktop.
Save YOzaz/1055381354a9e092c605 to your computer and use it in GitHub Desktop.
$count = clone($model);
$count = $count->count('orders.id');
$list = $model->skip( (\Paginator::getCurrentPage()-1) * $params['per_page'] )->take( $params['per_page'] )->get();
$list = \Paginator::make( $list->all(), $count, $params['per_page'] );
return $list;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment