title: How to disable pagination indicately first page, last page & indicately previous page, next page in Laravel
body: <p>Actually, I am trying to make pagination disable handler so that if I stay on the number 1 page the first page &amp; the previous page will be disabled and the next page &amp; last page will remain able to clickable, so as to, I can go next page and last page. In the same way, if I stay on the last page the next page &amp; last page will be disabled and the previous page &amp; first page will remain able to clickable. so as I can go to the previous page and the first page. How can I manage this system?</p>
  <blockquote>
  <p>Pagination view design:</p>
  </blockquote>
  <p>The first <strong>button</strong> is the <strong>first page</strong>, the <strong>second button</strong> is the <strong>previous page</strong> the third one is an <strong>input area</strong> for pagination number which the number of pages I want to go, the fourth <strong>button</strong> is the <strong>next page</strong>, the fifth <strong>button</strong> is the <strong>last page</strong>.</p>
  <p><a href="https://i.stack.imgur.com/nh7K0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nh7K0.png" alt="enter image description here" /></a></p>
  <blockquote>
  <p><strong>Function is here:</strong></p>
  </blockquote>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public function index(){
  
      $master_product_list = EbayMasterProduct::with('variationProducts')-&gt;orderByDesc('id')-&gt;paginate(50);
      $master_decode_product_list = json_decode(json_encode($master_product_list));
  
   return view('ebay.master_product.master_product_list',compact('master_product_list','master_decode_product_list'));
          }</code></pre>
  </div>
  </div>
  </p>
  <p><strong>Here is my pagination view code:</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="pagination-area"&gt;
    &lt;form action="{{url('pagination-all')}}" method="post"&gt;
        @csrf
        &lt;div class="datatable-pages d-flex align-items-center"&gt;
            &lt;span class="displaying-num"&gt;  {{$master_product_list-&gt;total()}} items&lt;/span&gt;
            &lt;span class="pagination-links d-flex"&gt;
                &lt;a class="first-page btn" href="{{$master_decode_product_list-&gt;first_page_url}}" data-toggle="tooltip" data-placement="top" title="First Page"&gt;
                    &lt;span class="screen-reader-text d-none"&gt;First page&lt;/span&gt;
                    &lt;span aria-hidden="true"&gt;«&lt;/span&gt;
                &lt;/a&gt;
                &lt;a class="prev-page btn" href="{{$master_decode_product_list-&gt;prev_page_url}}" data-toggle="tooltip" data-placement="top" title="Previous Page"&gt;
                    &lt;span class="screen-reader-text d-none"&gt;Previous page&lt;/span&gt;
                    &lt;span aria-hidden="true"&gt;‹&lt;/span&gt;
                &lt;/a&gt;
                &lt;span class="paging-input d-flex align-items-center"&gt;
                    &lt;label for="current-page-selector" class="screen-reader-text d-none"&gt;Current Page&lt;/label&gt;
                    &lt;input class="current-page" id="current-page-selector" type="text" name="paged" value="{{$master_decode_product_list-&gt;current_page}}" size="3" aria-describedby="table-paging"&gt;
                    &lt;span class="datatable-paging-text d-flex"&gt;of&lt;span class="total-pages"&gt;{{$master_decode_product_list-&gt;last_page}}&lt;/span&gt;&lt;/span&gt;
                    &lt;input type="hidden" name="route_name" value="ebay-master-product-list"&gt;
                &lt;/span&gt;
                &lt;a class="next-page btn" href="{{$master_decode_product_list-&gt;next_page_url}}" data-toggle="tooltip" data-placement="top" title="Next Page"&gt;
                    &lt;span class="screen-reader-text d-none"&gt;Next page&lt;/span&gt;
                    &lt;span aria-hidden="true"&gt;›&lt;/span&gt;
                &lt;/a&gt;
                &lt;a class="last-page btn" href="{{$master_decode_product_list-&gt;last_page_url}}" data-toggle="tooltip" data-placement="top" title="Last Page"&gt;
                    &lt;span class="screen-reader-text d-none"&gt;Last page&lt;/span&gt;
                    &lt;span aria-hidden="true"&gt;»&lt;/span&gt;
                &lt;/a&gt;
            &lt;/span&gt;
        &lt;/div&gt;
    &lt;/form&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>