title: How to design my pagination form in Laravel 5.6 and get control of it? In another words, how to use Paginator Instance Method?s
body: <p>How to use Paginator Instance Methods, so I can design my pagination in Laravel 5.6 instead of default?</p>
  
  <p>I tried to use this code dwon but I didn't understand the variable $elements and where did it came from:</p>
  
  <pre><code>@if ($paginator-&gt;hasPages())
      &lt;ul class="pagination"&gt;
          {{-- Previous Page Link --}}
          @if ($paginator-&gt;onFirstPage())
              &lt;li class="disabled"&gt;&lt;span&gt;&amp;laquo;&lt;/span&gt;&lt;/li&gt;
          @else
              &lt;li&gt;&lt;a href="{{ $paginator-&gt;previousPageUrl() }}" rel="prev"&gt;&amp;laquo;&lt;/a&gt;&lt;/li&gt;
          @endif
  
          {{-- Pagination Elements --}}
          @foreach ($elements as $element)
              {{-- "Three Dots" Separator --}}
              @if (is_string($element))
                  &lt;li class="disabled"&gt;&lt;span&gt;{{ $element }}&lt;/span&gt;&lt;/li&gt;
              @endif
  
              {{-- Array Of Links --}}
              @if (is_array($element))
                  @foreach ($element as $page =&gt; $url)
                      @if ($page == $paginator-&gt;currentPage())
                          &lt;li class="active"&gt;&lt;span&gt;{{ $page }}&lt;/span&gt;&lt;/li&gt;
                      @else
                          &lt;li&gt;&lt;a href="{{ $url }}"&gt;{{ $page }}&lt;/a&gt;&lt;/li&gt;
                      @endif
                  @endforeach
              @endif
          @endforeach
  
          {{-- Next Page Link --}}
          @if ($paginator-&gt;hasMorePages())
              &lt;li&gt;&lt;a href="{{ $paginator-&gt;nextPageUrl() }}" rel="next"&gt;&amp;raquo;&lt;/a&gt;&lt;/li&gt;
          @else
              &lt;li class="disabled"&gt;&lt;span&gt;&amp;raquo;&lt;/span&gt;&lt;/li&gt;
          @endif
      &lt;/ul&gt;
  @endif
  </code></pre>