original_string: protected function makeFromPaginator(Paginator $paginator):ResourceInterface
      {
          $resource = static::makeFromCollection($paginator->getCollection());
  
          if ($resource instanceof CollectionResource) {
              $queryParams = array_diff_key(app('request')->all(), array_flip(['page']));
              $paginator->appends($queryParams);
  
              $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
          }
  
          return $resource;
      }
code: protected function makeFromPaginator(Paginator $paginator):ResourceInterface
      {
          $resource = static::makeFromCollection($paginator->getCollection());
  
          if ($resource instanceof CollectionResource) {
              $queryParams = array_diff_key(app('request')->all(), array_flip(['page']));
              $paginator->appends($queryParams);
  
              $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
          }
  
          return $resource;
      }
code_tokens: protected function makeFromPaginator ( Paginator $ paginator ) : ResourceInterface { $ resource = static :: makeFromCollection ( $ paginator -> getCollection ( ) ) ; if ( $ resource instanceof CollectionResource ) { $ queryParams = array_diff_key ( app ( 'request' ) -> all ( ) , array_flip ( [ 'page' ] ) ) ; $ paginator -> appends ( $ queryParams ) ; $ resource -> setPaginator ( new IlluminatePaginatorAdapter ( $ paginator ) ) ; } return $ resource ; }
docstring: Make resource from an Eloquent paginator.
  
  @param  \Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator
  @return \League\Fractal\Resource\ResourceInterface
docstring_tokens: Make resource from an Eloquent paginator .