title: Laravel + Livewire: How to fix Pagination Elements Get method error
body: <p>Noob here. Help please.</p>
  <p>When I search for something in the input box, then clear the input box again. Then I click any of the Pagination Elements: 1, 2, 3, 4, 5, I get this error.</p>
  <p><strong>The GET method is not supported for this route. Supported methods: POST.</strong></p>
  <p>Here's the livewire component</p>
  <p>search.blade.php</p>
  <pre class="lang-php prettyprint-override"><code>@if ($paginator-&gt;hasPages())
      &lt;nav&gt;
          &lt;ul class=&quot;pagination&quot;&gt;
               {{--Previous Page Link--}}
              @if ($paginator-&gt;onFirstPage())
                  &lt;li class=&quot;page-item disabled&quot; aria-disabled=&quot;true&quot; aria-label=&quot;@lang('pagination.previous')&quot;&gt;
                  &lt;li class=&quot;page-item disabled&quot; aria-disabled=&quot;true&quot;&gt;
                      &lt;span class=&quot;page-link&quot; aria-hidden=&quot;true&quot;&gt;&amp;lsaquo;&lt;/span&gt;
                  &lt;/li&gt;
              @else
                  &lt;li class=&quot;page-item&quot;&gt;
                      &lt;button class=&quot;page-link&quot; wire:click=&quot;previousPage&quot; rel=&quot;prev&quot;&gt;&amp;lsaquo;&lt;/button&gt;
                  &lt;/li&gt;
              @endif
  
               {{--Pagination Elements--}}
              @foreach ($elements as $element)
                   {{--&quot;Three Dots&quot; Separator--}}
                  @if (is_string($element))
                      &lt;li class=&quot;page-item disabled&quot; aria-disabled=&quot;true&quot;&gt;&lt;span class=&quot;page-link&quot;&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=&quot;page-item active&quot; aria-current=&quot;page&quot;&gt;&lt;span class=&quot;page-link&quot;&gt;{{ $page }}&lt;/span&gt;&lt;/li&gt;
                          @else
                              &lt;li class=&quot;page-item&quot;&gt;&lt;a class=&quot;page-link&quot; href=&quot;{{ $url }}&quot;&gt;{{ $page }}&lt;/a&gt;&lt;/li&gt;
                          @endif
                      @endforeach
                  @endif
              @endforeach
  
               {{--Next Page Link--}}
              @if ($paginator-&gt;hasMorePages())
                  &lt;li class=&quot;page-item&quot;&gt;
                      &lt;button class=&quot;page-link&quot; wire:click=&quot;nextPage&quot; rel=&quot;next&quot; aria-label=&quot;@lang('pagination.next')&quot;&gt;&amp;rsaquo;&lt;/button&gt;
                  &lt;/li&gt;
              @else
                  &lt;li class=&quot;page-item disabled&quot; aria-disabled=&quot;true&quot; aria-label=&quot;@lang('pagination.next')&quot;&gt;
                  &lt;li class=&quot;page-item disabled&quot; aria-disabled=&quot;true&quot;&gt;
                      &lt;span class=&quot;page-link&quot; aria-hidden=&quot;true&quot;&gt;&amp;rsaquo;&lt;/span&gt;
                  &lt;/li&gt;
              @endif
          &lt;/ul&gt;
      &lt;/nav&gt;
  @endif
  
  </code></pre>
  <p>search-students.blade.php</p>
  <pre class="lang-php prettyprint-override"><code>{{-- CARD BODY --}}
  &lt;div class=&quot;card-body&quot;&gt;
      &lt;div id=&quot;example1_wrapper&quot; class=&quot;dataTables_wrapper dt-bootstrap4&quot;&gt;
          &lt;div class=&quot;row&quot;&gt;
              &lt;div class=&quot;col-sm-12 col-md-6&quot;&gt;
                  &lt;div id=&quot;example1_filter&quot; class=&quot;dataTables_filter&quot;&gt;
                      &lt;label&gt;Search:&lt;input type=&quot;search&quot; class=&quot;form-control form-control-sm&quot; placeholder=&quot;&quot; wire:model=&quot;searchText&quot;&gt;
                      &lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;row&quot;&gt;
              &lt;div class=&quot;col-sm-12&quot;&gt;
                  &lt;table id=&quot;example1&quot; class=&quot;table table-bordered table-striped dataTable dtr-inline&quot; role=&quot;grid&quot;
                         aria-describedby=&quot;example1_info&quot;&gt;
                      &lt;thead&gt;
                      &lt;tr role=&quot;row&quot;&gt;
                          &lt;th class=&quot;sorting_asc&quot; tabindex=&quot;0&quot; aria-controls=&quot;example1&quot; rowspan=&quot;1&quot; colspan=&quot;1&quot; aria-sort=&quot;ascending&quot;&gt;First Name&lt;/th&gt;
                          &lt;th class=&quot;sorting&quot; tabindex=&quot;0&quot; aria-controls=&quot;example1&quot; rowspan=&quot;1&quot; colspan=&quot;1&quot;&gt;Last Name&lt;/th&gt;
                          &lt;th class=&quot;sorting&quot; tabindex=&quot;0&quot; aria-controls=&quot;example1&quot; rowspan=&quot;1&quot; colspan=&quot;1&quot;&gt;Image&lt;/th&gt;
                      &lt;/thead&gt;
                      &lt;tbody&gt;
                      @foreach($students as $student)
  
                          &lt;tr role=&quot;row&quot; class=&quot;odd&quot;&gt;
                              &lt;td class=&quot;sorting_1 dtr-control&quot;&gt;{{ $student-&gt;FirstName }}&lt;/td&gt;
                              &lt;td&gt;{{ $student-&gt;LastName }}&lt;/td&gt;
                              &lt;td&gt;&lt;img src=&quot;StudentImage/{{ $student-&gt;ImageLink }}.jpg&quot; width=&quot;120&quot; height=&quot;150&quot;&gt;&lt;/td&gt;
  
                          &lt;/tr&gt;
                      @endforeach
                      &lt;/tbody&gt;
  
                      &lt;tfoot&gt;
                      &lt;tr&gt;
                      &lt;/tfoot&gt;
                  &lt;/table&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;col-sm-12 col-md-7&quot;&gt;
              {{ $students-&gt;links('livewire.livewire-pagination') }}
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  {{-- card body --}}
  
  </code></pre>