PHPackages                             alitalaghat/slim-facades - 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. alitalaghat/slim-facades

ActiveLibrary[Framework](/categories/framework)

alitalaghat/slim-facades
========================

Facades for Slim 4.

044PHP

Since Mar 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/alitalaghat/slim-facades)[ Packagist](https://packagist.org/packages/alitalaghat/slim-facades)[ RSS](/packages/alitalaghat-slim-facades/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Slim Facades
============

[](#slim-facades)

Introduction
------------

[](#introduction)

SlimFacades is a package to provide facades for [Slim PHP framework](https://www.slimframework.com). This package is based on [slim-facdes](https://github.com/zhshize/slim-facades) by @zhangshize.

Facades is a noun from [Laravel](https://laravel.com)(also a PHP Framework). Facades provide a "static" interface to classes that are available in the application's service container.

Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods, so does Slim-Facades.

Requirement
-----------

[](#requirement)

- PHP &gt;= 7.2
- Slim &gt;= 4.0

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

[](#installation)

Using [composer](https://getcomposer.org/):
`composer require alitalaghat/slim-facades`

Usage
-----

[](#usage)

After the installation, you can update your code like this:

```
    //... Something not important ...
    use SlimFacades\Facade;
    use SlimFacades\Route;
    use SlimFacades\App;

    // Create Container using PHP-DI
    $container = new Container();

    // Set container to create App with on AppFactory
    AppFactory::setContainer($container);

    $app = AppFactory::create();
    // initialize the Facade class
    Facade::setFacadeApplication($app);

    Route::get('/', function (Request $req, Response $res) {
        $res->getBody()->write("Hello");
        return $res;
    });

    App::run();
```

Default Facades
---------------

[](#default-facades)

The following facades are provided by Slim-Facades:

### App

[](#app)

Use it just like using $app!

```
    App::run();
```

### Container

[](#container)

Use it just like using $container!

```
    Container::has('view');
```

### Route

[](#route)

```
    Route::get('/', function (Request $req, Response $res) {
        $res->getBody()->write("Hello");
        return $res;
    });
```

Custom Facades
--------------

[](#custom-facades)

The code for creating a custom facades for a service in the container is the following:

```
using SlimFacades\Facade;
class CustomFacade extends Facade
{
    protected static function getFacadeAccessor()
    {
        //Change 'serviceName' to you want.
        return 'serviceName';
    }
}
```

The code for creating a custom facades for an instance is the following:

```
using SlimFacades\Facade;
class CustomFacade extends Facade
{
    public static function self()
    {
        //Change the returned value to you want.
        return self::$app->getContainer()->get('myservice');
    }
}
```

Licence
-------

[](#licence)

[Apache License Version 2.0.](LICENSE)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf1cc150f1d844d0d658347ef6819a068c0cb80ac6ab52c1b33533d2c140556d?d=identicon)[alitalaghat](/maintainers/alitalaghat)

---

Top Contributors

[![alitalaghat](https://avatars.githubusercontent.com/u/8073213?v=4)](https://github.com/alitalaghat "alitalaghat (2 commits)")

### Embed Badge

![Health badge](/badges/alitalaghat-slim-facades/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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