Level 75
Read this post http://laravel.io/forum/11-13-2014-laravel-5-pagination
Is there an easy way of swapping the default LengthAwarePaginator contract implementation so that it can still be used with the default methods on the Eloquent\Builder? By the look of it Builder uses concrete implementation:
public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null)
{
$page = $page ?: Paginator::resolveCurrentPage($pageName);
$total = $this->getCountForPagination($columns);
$results = $this->forPage($page, $perPage)->get($columns);
return new LengthAwarePaginator($results, $total, $perPage, $page, [
'path' => Paginator::resolveCurrentPath(),
'pageName' => $pageName,
]);
}
I want to build a pagination with form select to pick the page and previous / next buttons etc. but would like to keep the remaining functionality with the methods and the whole query with separate count and limit with the offset.
Please or to participate in this conversation.