you must use
$links = Pagination::makeLengthAware(Here your pagined collection, Here the total of records, Here the number of records per page);
as @bestmomo answered in http://laravel.io/forum/11-13-2014-laravel-5-pagination
Hi All is there any simple example of custom pagination in laravel5?
Thnaks
you must use
$links = Pagination::makeLengthAware(Here your pagined collection, Here the total of records, Here the number of records per page);
as @bestmomo answered in http://laravel.io/forum/11-13-2014-laravel-5-pagination
also there is doc in http://laravel.com/docs/master/pagination
@skashizadeh the io forum reference is now obsolete. Just use the Paginator class.
can i see some example code ??
@efcoders look at the BootstrapThreePresenter.php and SimpleBootstrapThreePresenter.php files that ship with laravel 5 for example code.
Really, just look at the entire Pagination directory: vendor/laravel/framework/src/Illuminate/Pagination
well to be honest i am new on laravel..any guy can give me some link or tell me step by step how to implement this .... Thanks
I tried @bestmomo's solutio but now i am getting
BindingResolutionException in Container.php line 872:
Unresolvable dependency resolving [Parameter #0 [
error..
can any one please suggest?
Thanks
I know it's a year late! but I got it working using this method:
use Illuminate\Pagination\Paginator;
class someController extends Controller {
public function someFunction(){
$results = array();
$ready = new Paginator($results, 10);
dd($ready);
}
}
@max101 That will allow for current query string data?
Really with a little bit of digging around in PHP forums, a paginator is simple to write.
@ bashy yes, but it feels a bit messy. @jlrdw you are right and it's not difficult but if it exists in the framework use it :) just to save time.
Codecourse video about custom paginators in L5 released last month https://youtu.be/4ONOVZsMhAA
@max101 that statement is kind of a paradox, it seems like the majority of laravel users end up pulling in external packages to do things, like some will pull in data tables where as I write my own HTML tables. An example I recently did a project that had inline editing, but I used a regular PHP / html table.
This http://laravel.io/forum/11-13-2014-laravel-5-pagination
Still works.
Please or to participate in this conversation.