custom pagination laravel css code example

Example 1: custom pagination laravel css

php artisan vendor:publish --tag=laravel-pagination
  OR
use Illuminate\Pagination\Paginator;

public function boot()
{
    Paginator::defaultView('your-pagination-view-name');

}

Example 2: custom laravel pagination

@if ($paginator->hasPages())
    
    @if ($paginator->onFirstPage())
  • ← Previous
  • @else
  • @endif @foreach ($elements as $element) @if (is_string($element))
  • {{ $element }}
  • @endif @if (is_array($element)) @foreach ($element as $page => $url) @if ($page == $paginator->currentPage())
  • {{ $page }}
  • @else
  • {{ $page }}
  • @endif @endforeach @endif @endforeach @if ($paginator->hasMorePages())
  • @else
  • Next →
  • @endif
@endif

Tags:

Misc Example