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.