PHPackages                             renanonline8/slim-utils - 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. renanonline8/slim-utils

ActiveLibrary[Framework](/categories/framework)

renanonline8/slim-utils
=======================

Tools for Slim Framework

1.0.0(7y ago)014MITPHP

Since May 8Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (13)Used By (0)

Slim Utils
==========

[](#slim-utils)

Tools for Slim Framework 3.

Install
-------

[](#install)

```
composer require renanonline8/slim-utils

```

Usage
-----

[](#usage)

### BaseController

[](#basecontroller)

This class has the purpose of creating a controller class

1. Create the class

```
namespace App\Controller;

use \SlimUtils\Controller\BaseController;
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;

final class Controller extends BaseController
{

    public function control(Request $request, Response $response, Array $args)
    {
        //implement the code...

        //for use a container...
        $this->containerName->functionContainer();
    }
}
```

2. Create a container with Controller

```
$container['ControllerIndex'] = function($c) {
    return new \App\Controller\ControllerIndex($c);
};
```

3. Implement the route

```
$app->get('/[{name}]', 'Controller:control');
```

### Middleware

[](#middleware)

This class has the purpose be a Middleware abstract with easy access of container

1. Create the class

```
namespace App\Middleware;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use \SlimUtils\Middleware\BaseMiddleware;
use \SlimUtils\Middleware\InterfaceMiddleware;

class ExampleMid extends BaseMiddleware implements InterfaceMiddleware
{
    public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)
    {
        //for use a container...
        $this->containerName->functionContainer();

        $response->getBody()->write('BEFORE');
        $response = $next($request, $response);
        $response->getBody()->write('AFTER');

        return $response;
    }
}
```

2. Add Middleware at the route

```
$app->get('/[{name}]', 'Controller:control')->add(new ExampleMid($container));
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity67

Established project with proven stability

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 ~5 days

Total

5

Last Release

2588d ago

Major Versions

0.2.2 → 1.0.02019-05-30

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6172870?v=4)[Renan Santos Gomes](/maintainers/renanonline8)[@renanonline8](https://github.com/renanonline8)

### Embed Badge

![Health badge](/badges/renanonline8-slim-utils/health.svg)

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

###  Alternatives

[zubzet/framework

 A lightweight PHP framework focused on rapid development, ease of use, and great portability.

1370.1k1](/packages/zubzet-framework)[vesp/core

Vesp core library to make backend simple

243.9k5](/packages/vesp-core)[duxweb/dux-lite

The lightweight framework based on slim php

161.0k9](/packages/duxweb-dux-lite)

PHPackages © 2026

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