I’ve been using the Slim Framework a lot recently, both in existing clients and for bootstrapping simple web applications. For new projects I’ve chosen it over the likes of Laravel and Symfony because I can get a prototype up and running quicker, and I don’t need to learn lots of framework-specific tools. The other major reason for choosing Slim is that it still supports PHP 7.4, whereas Laravel and Symfony are quick to increase their minimum PHP requirements.
Even with the reduced complexity of Slim, there are still some bootstrap tasks that I find myself going through on every new project. These include:
- Installing Slim and other dependencies
- Configuring libraries such as Doctrine ORM
- Connecting libraries together, e.g. Slim + Twig
- Docker configuration for local development
- Visual Studio Code configuration, e.g. to exclude files from searches
Since none of these tasks contain any client-specific code, I’ve released them as the phpdev-uk/slim-skeleton package, which is available via Composer.
The skeleton repository is largely feature-complete, although I will probably make tweaks over time, and I regularly update the Composer dependencies.
Pingback: Moving Slim Skeleton to PHP 8.3 – PHP Developer