If you work with Slim you probably use Eloquent to retrieve and know that Eloquent is a ORM tool meant to be used within Laravel so its usage outside it is not very well documented.
if you want your query to include pagination you use:
$yourquery->links();
What if your Bootstrap version doesn't match Eloquent Pagination's? Support for Bootstrap 3/4 is built in however, Bootstrap 4 is not enabled in Pagination 5.2 at least.
To enable that you'd have to add an instance of the Bootstrap4Presenter.
$yourquery->links(new \Illuminate\Pagination\BootstrapFourPresenter($yourquery));
And that's it! It's hinted in Laravel's documentation but the info in there is not meant for non Laravel users. It took me a while to figure it out so I thought I'd share it with more people. Hope it helps.