This project has the minimal implementation for an "Automatic REST API for SlimPHP 4" as described in this post
Run it using:
php -S localhost:8080
And visit the URL:
Replace "posts" with the name of any table in your database. If everything works as expected, then you should see the contents of the table in JSON format.