PHPackages                             effectra/facade - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. effectra/facade

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

effectra/facade
===============

The Effectra Facade Class.

v1.0.0(3y ago)06MITPHPPHP ^8.0.2

Since May 26Pushed 3y agoCompare

[ Source](https://github.com/effectra/facade)[ Packagist](https://packagist.org/packages/effectra/facade)[ RSS](/packages/effectra-facade/feed)WikiDiscussions main Synced today

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

Facade Class
============

[](#facade-class)

The `Facade` class is a utility class that provides a simplified interface to access classes or services in your PHP applications.

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

[](#installation)

The `Facade` class is a standalone class and doesn't require any installation. You can simply include the class file in your project.

```
composer require effectra/facade
```

Usage
-----

[](#usage)

To use the `Facade` class, follow these steps:

1. Extend the `Facade` class with your custom facade class.
2. Implement the `getFacadeAccessor()` method in your custom facade class.
3. Optionally, set the resolved instance or container using the `setResolvedInstance()` or `setContainer()` method respectively.
4. Access the methods of the underlying class or service using the static methods of your custom facade class.

Here's an example:

```
use Effectra\Facade;

class MyFacade extends Facade
{
    protected static function getFacadeAccessor()
    {
        return MyService::class;
    }
}

// Usage
MyFacade::setResolvedInstance(new MyService());
MyFacade::someMethod();
```

In this example, we've created a custom facade class `MyFacade` by extending the `Facade` class. The `getFacadeAccessor()` method in `MyFacade` returns the class name of `MyService` that we want to access using the facade.

By setting the resolved instance using `setResolvedInstance()`, we directly provide an instance of `MyService` to the facade. This allows us to access the methods of `MyService` using the static methods of `MyFacade`.

You can also use a container instead of setting the resolved instance directly. To do so, create a container, bind the class name to a key in the container, and set the container using `setContainer()`.

```
use Effectra\Facade;
use Effectra\Container\Container;

class MyFacade extends Facade
{
    protected static function getFacadeAccessor()
    {
        return 'myService';
    }
}

// Usage
$container = new Container();
$container->bind('myService', MyService::class);

MyFacade::setContainer($container);
MyFacade::someMethod();
```

In this example, we've used a simple `Container` class to bind the class name of `MyService` to the key `'myService'`. By setting the container using `setContainer()`, the `Facade` class resolves the instance from the container when the static method is called.

Make sure to replace `'MyService'` and `'someMethod()'` with the actual class and method names you're using in your application.

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

[](#contributing)

Contributions are welcome! If you find any issues or would like to add new features or improvements, please open an issue or submit a pull request.

Before contributing, please make sure to review the [contribution guidelines](CONTRIBUTING.md).

License
-------

[](#license)

This class is open-source and available under the [MIT License](LICENSE).

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e6219ae87e98df8783b2f595b013035dd183c0712afd24045a8acf0a40c3bdf?d=identicon)[effectra](/maintainers/effectra)

---

Top Contributors

[![BMTmohammedtaha](https://avatars.githubusercontent.com/u/95439605?v=4)](https://github.com/BMTmohammedtaha "BMTmohammedtaha (5 commits)")

---

Tags

facadephp

### Embed Badge

![Health badge](/badges/effectra-facade/health.svg)

```
[![Health](https://phpackages.com/badges/effectra-facade/health.svg)](https://phpackages.com/packages/effectra-facade)
```

###  Alternatives

[urbanairship/urbanairship

Urban Airship PHP Library

38626.1k2](/packages/urbanairship-urbanairship)[caffeinated/flash

Flash Messages for Laravel

4650.4k2](/packages/caffeinated-flash)[humanmade/block-supports-extended

Block supports extension helpers

134.0k](/packages/humanmade-block-supports-extended)

PHPackages © 2026

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