PHPackages                             dlundgren/slim-turbo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. dlundgren/slim-turbo

ActiveLibrary[Framework](/categories/framework)

dlundgren/slim-turbo
====================

SlimTurbo is an add on to Slim to enable full route caching

0.5.1(9mo ago)3157MITPHPCI passing

Since Sep 19Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/dlundgren/slim-turbo)[ Packagist](https://packagist.org/packages/dlundgren/slim-turbo)[ RSS](/packages/dlundgren-slim-turbo/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (10)Versions (15)Used By (0)

Slim Turbo
==========

[](#slim-turbo)

Slim Turbo is an extension to [Slim Framework](https://github.com/slimphp/Slim) that allows you to cache the Route names and Routes directly in a compiled Dependency Injection container.

It's recommended to use [Slim](https://github.com/slimphp/Slim) without this package, for DI containers that do not compile.

Installation
------------

[](#installation)

It's recommended to use [Composer](https://getcomposer.org) to install Slim Turbo.

```
$ composer require dlundgren/slim-turbo
```

This will install Slim Turbo and all required dependencies. Like Slim, Slim Turbo requires PHP 7.1.

Usage
-----

[](#usage)

Create a class that extends [Slim\\Turbo\\Provider\\RouteProvider](src/Provider/RouteProvider.php) and implement the `register()` method. Routes are defined similarly to using `Slim\App` and it's recommended to use class names, service names, or strings when adding middleware and route callables. These will be loaded from the Container as needed.

**NOTE** Closures may be used with SlimTurbo, but it's recommended to only use them while in development. It is undefined behavior (from SlimTurbo's perspective) to use Closures in production.

Domain Routing
--------------

[](#domain-routing)

Domain based routing is available by using `Router::domain($domain, $callable)`. This operates in a similar manner to how `Router::group($pattern, $callable)` works.

There are a few options that you can provide to the `DomainResolver` when setting it up.

optiondefaultdescriptionuseSubdomainOnlytruestrip off the domain portionignoreHosts\[\]List of hosts that should not be added to the route### Using subdomain only

[](#using-subdomain-only)

This currently implements a very basic count of `.` and drops the parts near the last dot.

Examples:

```
api.example.com > api
api.service.example.com > api.service

```

Caching Routing information
---------------------------

[](#caching-routing-information)

In order to cache the route information that is generated you **MUST** set a `routing.cache` key in your DI container to a [SimpleCache](https://packagist.org/providers/psr/simple-cache-implementation) implementation.

Service Provider Initialization
-------------------------------

[](#service-provider-initialization)

Slim Turbo provides service providers for the following Dependency Injection containers:

- [Symfony Dependency Injection](examples/symfony/index.php)
- [PHP DI](examples/php-di/index.php)

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

Slim Turbo is licensed under the MIT license. See [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance57

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~168 days

Recently: every ~477 days

Total

14

Last Release

281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5eb9bc1606754fee81247bf5d4a6a4d7fb7cce1b3769de69a345c5c8e120211e?d=identicon)[dlundgren](/maintainers/dlundgren)

---

Top Contributors

[![dlundgren](https://avatars.githubusercontent.com/u/1322393?v=4)](https://github.com/dlundgren "dlundgren (35 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

apiframeworkmicrorouter

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dlundgren-slim-turbo/health.svg)

```
[![Health](https://phpackages.com/badges/dlundgren-slim-turbo/health.svg)](https://phpackages.com/packages/dlundgren-slim-turbo)
```

###  Alternatives

[slim/slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

12.3k51.8M1.4k](/packages/slim-slim)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
