title: laravel: how to remove first pagination when click next page of 2nd pagination
body: <p>i have index page with two pagination passing to. first i gave to slide to show featured items and then there is other items after that slider coming through 2nd pagination. but when i click next page. the first pagination items doesn't show but the header of that div remains. my question is what i can do to remove that whole div of slider of featured items on any other page than index page and page after ?page=1 at url. i tried to put if condition but when there is not get value at url it give me error. is there any solution that can hide whole slider div on any other page than 1 and simple index.</p>
  
  <pre><code>    class IndexController extends Controller
      {
          public function Index(){
              //Get all Products 
              $allProducts = DB::table('categories')
                  -&gt;join('products','products.category_id','=', 'categories.id')
                  -&gt;where('categories.status','=','1')-&gt;where('products.status','=','1')-&gt;paginate(9);
  
  
              // Get featured products
              $featuredProducts = DB::table('categories')
                  -&gt;join('products','products.category_id','=', 'categories.id')
                  -&gt;where('categories.status','=','1')-&gt;where('products.status','=','1')-&gt;where('feature_item',1)-&gt;paginate(25);
  
  
              //Get all Categories and sub Categories
              $categories = Category::with('categories')-&gt;where(['parent_id'=&gt;0])-&gt;get();
  
              $banners = Banner::where('status','1')-&gt;get();
  
              return view('index')-&gt;with(compact('featuredProducts','allProducts','categories','banners'));
  
          }
      }
  </code></pre>
  
  <hr>
  
  <pre><code>   &lt;section&gt;
      &lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-sm-3"&gt;
                  @include('layouts.frontLayout.front_sidebar')
              &lt;/div&gt;
                &lt;div class="col-sm-9 padding-right"&gt;
                   &lt;div class="features_items"&gt;
                      &lt;h2 class="title text-center"&gt;Featured Items&lt;/h2&gt;
                      &lt;div id="recommended-item-carousel" class="carousel slide" data-ride="carousel"&gt;
                          &lt;div class="carousel-inner"&gt;
                              &lt;?php $count=1; ?&gt; 
                              @foreach($featuredProducts-&gt;chunk(3) as $chunk)
                                  &lt;div &lt;?php if($count==1){ ?&gt; class="item active" &lt;?php }else{ ?&gt; class="item" &lt;?php } ?&gt;&gt;
                                      @foreach($chunk as $item)   
                                          &lt;div class="col-sm-4"&gt;
                                              &lt;div class="product-image-wrapper"&gt;
                                                  &lt;div class="single-products"&gt;
                                                      &lt;div class="productinfo text-center"&gt;
                                                          &lt;img style="width:200px;" src="{{ asset('images/backend_images/products/small/'.$item-&gt;image) }}" alt="" /&gt;
                                                          &lt;h2&gt;$ {{ $item-&gt;price }} &lt;/h2&gt;
                                                          &lt;p&gt; {{ $item-&gt;product_name }}&lt;/p&gt;
                                                          &lt;a href="{{ url('/product/'.$item-&gt;id) }}"&gt;
                                                              &lt;button type="button" class="btn btn-default add-to-cart"&gt;&lt;i class="fa fa-shopping-cart"&gt;&lt;/i&gt;Add to cart&lt;/button&gt;
                                                          &lt;/a&gt;
                                                      &lt;/div&gt;
                                                  &lt;/div&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                      @endforeach
                                  &lt;/div&gt;
                              &lt;?php $count++; ?&gt;
                              @endforeach
                          &lt;/div&gt;
                           &lt;a class="left recommended-item-control" href="#recommended-item-carousel" data-slide="prev"&gt;
                              &lt;i class="fa fa-angle-left"&gt;&lt;/i&gt;
                            &lt;/a&gt;
                            &lt;a class="right recommended-item-control" href="#recommended-item-carousel" data-slide="next"&gt;
                              &lt;i class="fa fa-angle-right"&gt;&lt;/i&gt;
                            &lt;/a&gt;          
                      &lt;/div&gt;
                   &lt;/div&gt;
                &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-sm-3"&gt;
  
              &lt;/div&gt;
              &lt;div class="col-sm-9 padding-right"&gt;
                  &lt;div class="features_items"&gt;&lt;!--features_items--&gt;
                      &lt;h2 class="title text-center"&gt;All Items&lt;/h2&gt;
                      @foreach($allProducts as $product)
                      &lt;div class="col-sm-4"&gt;
                          &lt;a class="product-image-wrapper" href="{{ url('product/'.$product-&gt;id) }}"&gt;
                              &lt;div class="single-products"&gt;
                                      &lt;div class="productinfo text-center"&gt;
                                          &lt;img src="{{ asset('images/backend_images/products/small/'.$product-&gt;image) }}" alt="" /&gt;
                                          &lt;h2&gt;C$ {{ $product-&gt;price }}&lt;/h2&gt;
                                          &lt;p&gt;{{ $product-&gt;product_name }}&lt;/p&gt;
                                          &lt;a href="{{ url('product/'.$product-&gt;id) }}" class="btn btn-default add-to-cart"&gt;&lt;i class="fa fa-shopping-cart"&gt;&lt;/i&gt;Add to cart&lt;/a&gt;
                                      &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/a&gt;
                      &lt;/div&gt;
                      @endforeach
                  &lt;/div&gt;&lt;!--features_items--&gt; 
                  &lt;div align="center"&gt;{{ $allProducts-&gt;links() }}&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>