@if ($items->hasPages())
<div class="pagination-wrapper">
{{ $items->links() }}
</div>
@endif
DB::table('users') -> paginate(15)
//2 show pagination in blade file
@if ($items->hasPages())
<div class="pagination-wrapper">
{{ $items->links() }}
</div>
@endif
/**
* AppServiceProvider.php
*/
use IlluminatePaginationPaginator; // Don't forget this
public function boot ()
{
Paginator::useBootstrap(); // Add this
}
"Showing {{ $products->firstItem() }}–{{ $products->lastItem() }} of {{ $products->total() }} results"
use IlluminatePaginationPaginator;
public function boot()
{
Paginator::useBootstrap();
}
// Instead of
$products = Product::paginate(8);
// Now you can do this
$products = Product::simplePaginate(8);