Let's say you have a table, that's sortable (e.g. via table headings), filterable (using your own implementation of whatever it is you are filtering) via $_GET/request()->query parameters. Normally, links that are generated for pagination/sorting do not including any already set query parameters. This request macro fixes that.
Example of the links generated with persistent query parameters for table headings/pagination