original_string: protected function handleInvalidPage(LengthAwarePaginator $paginator)
      {
          if ($paginator->lastPage() && $paginator->currentPage() > $paginator->lastPage()) {
              $lastPageUrl = Request::fullUrlWithQuery([
                  $paginator->getPageName() => $paginator->lastPage(),
              ]);
  
              Pjax::respond(redirect($lastPageUrl));
          }
      }
code: protected function handleInvalidPage(LengthAwarePaginator $paginator)
      {
          if ($paginator->lastPage() && $paginator->currentPage() > $paginator->lastPage()) {
              $lastPageUrl = Request::fullUrlWithQuery([
                  $paginator->getPageName() => $paginator->lastPage(),
              ]);
  
              Pjax::respond(redirect($lastPageUrl));
          }
      }
code_tokens: protected function handleInvalidPage ( LengthAwarePaginator $ paginator ) { if ( $ paginator -> lastPage ( ) && $ paginator -> currentPage ( ) > $ paginator -> lastPage ( ) ) { $ lastPageUrl = Request :: fullUrlWithQuery ( [ $ paginator -> getPageName ( ) => $ paginator -> lastPage ( ) , ] ) ; Pjax :: respond ( redirect ( $ lastPageUrl ) ) ; } }
docstring: If current page is greater than last page, then redirect to last page.
  
  @param LengthAwarePaginator $paginator
  
  @return void
docstring_tokens: If current page is greater than last page then redirect to last page .