Merge pull request #996 from Jakobud/feature/pagination-docs
Added documentation for paginate's second optional argument.
This commit is contained in:
commit
c27614b217
|
@ -22,6 +22,10 @@ #### Pull the paginated results from the query:
|
||||||
|
|
||||||
$orders = DB::table('orders')->paginate($per_page);
|
$orders = DB::table('orders')->paginate($per_page);
|
||||||
|
|
||||||
|
You can also pass an optional array of table columns to select in the query:
|
||||||
|
|
||||||
|
$orders = DB::table('orders')->paginate($per_page, array('id', 'name', 'created_at'));
|
||||||
|
|
||||||
#### Display the results in a view:
|
#### Display the results in a view:
|
||||||
|
|
||||||
<?php foreach ($orders->results as $order): ?>
|
<?php foreach ($orders->results as $order): ?>
|
||||||
|
|
Loading…
Reference in New Issue