title: How to make a Laravel Eloquent Resource include filter parameters in the links?
body: <p>We're experimenting a bit with the query builder by Spatie, and I would like to return a Resource collection.</p>
  
  <p>Unfortunately, when you add filters to the request, these are not sent back as part of the first, last, previous and next links of the reply.</p>
  
  <p>this is our code (just an example with a very simple mode <code>ExchangeRate</code>:</p>
  
  <pre><code>class ExchangeRateController extends Controller
  {
      public function index(Request $request) {
         return \App\Resources\ExchangeRate::collection(
           QueryBuilder::for(ExchangeRate::class)
              -&gt;allowedFilters(
                  Filter::exact('currency'), 
                  Filter::scope('valid-on')
              )
              -&gt;paginate());
      }
  }
  </code></pre>
  
  <p>When we call <code>GET /api/exchangerates</code>, we're getting 3 pages of 15 records each.  When we call <code>GET /api/exchangerates?filter[currency]=USD</code>we're getting 1 page with just 1 record.  This is all fine, but the links in the json response don't get correct links.</p>
  
  <p>Without the filter, we're getting the following links:</p>
  
  <pre><code>"links": {
    "first": "https://example.com/api/exchangerates?page=1",
    "last": "https://example.com/api/exchangerates?page=3",
    "prev": null,
    "next": "https://example.com/api/exchangerates?page=2"
  }
  </code></pre>
  
  <p>With the filter, we're getting the following links in the response:</p>
  
  <pre><code>"links": {
    "first": "https://example.com/api/exchangerates?page=1",
    "last": "https://example.com/api/exchangerates?page=1",
    "prev": null,
    "next": null
  }
  </code></pre>
  
  <p>So, it gets its pagination done right, but the filters are not included in the links, which I believe is incorrect (the client should be able to trust those links to fetch the <em>next page</em> of its currently selected dataset...)</p>
  
  <p>Is there anyway that we can do this?</p>