PHPackages                             algoyounes/bindify - 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. algoyounes/bindify

ActiveLibrary

algoyounes/bindify
==================

Laravel Package Bindify is a package that helps you to bind your classes to the Laravel service container

v1.2.3(11mo ago)153455MITPHPPHP ^8.2CI passing

Since Dec 5Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/algoyounes/Bindify)[ Packagist](https://packagist.org/packages/algoyounes/bindify)[ RSS](/packages/algoyounes-bindify/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (10)Used By (0)

[![Bindify Logo](assets/logo.png)](assets/logo.png)
**Bindify**

[![Build Status](https://github.com/algoyounes/bindify/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/algoyounes/bindify/actions)[![Total Downloads](https://camo.githubusercontent.com/2cd27afd4b31bac0fb50fa9acbe2a209e77a0e8f039e1510470837bd8ec98a29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c676f796f756e65732f62696e64696679)](https://packagist.org/packages/algoyounes/bindify)[![Latest Stable Version](https://camo.githubusercontent.com/f08cc39096fedfcbc226f558a18cea0edb24d31d96eff721dfa3ff042c0ee5f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c676f796f756e65732f62696e64696679)](https://packagist.org/packages/algoyounes/bindify)[![License](https://camo.githubusercontent.com/2807b89b5b3393a2d8007128b0c4bd06a6bdd947b88d87ab560fb3e4d7df585d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616c676f796f756e65732f62696e64696679)](https://packagist.org/packages/algoyounes/bindify)

**Bindify** is a Laravel package that provides attributes to bind interfaces to their implementations **lazily**.

Note

This package requires PHP 8.2+

Features ✨
----------

[](#features-)

- **Declarative bindings** using `#[BindWith]` attributes
- **Lazy registration** *(bindings are registered when first resolved)*
- **Seamless integration** with Laravel's service container
- **Multiple binding types** *(Singleton, Transient)*
- **Tagged bindings**

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

[](#installation)

You can install the package via composer:

```
composer require algoyounes/bindify

```

Usage
-----

[](#usage)

### Basic Binding

[](#basic-binding)

Define your interface with the `#[BindWith]` attribute:

```
namespace App\Contracts;

use AlgoYounes\Bindify\Attributes\BindWith;
use AlgoYounes\Bindify\Attributes\BindType;
use App\Services\DefaultService;

#[BindWith(DefaultService::class, BindType::Singleton)]
interface ServiceContract
{
    public function execute();
}
```

Create your implementation:

```
namespace App\Services;

use App\Contracts\ServiceContract;

class DefaultService implements ServiceContract
{
    public function execute()
    {
        // Your implementation
    }
}
```

### Binding Types

[](#binding-types)

TypeDescription`BindType::Singleton`Shares the same instance everywhere`BindType::Transient`Creates a new instance each time### Advanced Binding

[](#advanced-binding)

#### Multiple Implementations

[](#multiple-implementations)

Bind multiple implementations to an interface:

```
namespace App\Contracts;

use AlgoYounes\Bindify\Attributes\BindWith;
use AlgoYounes\Bindify\Attributes\BindType;

#[BindWith([DefaultService::class, AlternativeService::class], BindType::Singleton)]
interface ServiceContract
{
    // ...
}
```

#### Tagged Bindings

[](#tagged-bindings)

Explicitly tag your bindings:

```
#[BindWith([DefaultService::class], BindType::Singleton, tag: 'primary')]
```

Note

**When no tag is provided and there are multiple services**, will auto-generates a tag by appending `_tag`

### Retrieving Bindings

[](#retrieving-bindings)

Resolve your bindings as usual through container:

```
$service = app(ServiceContract::class);

$services = app()->tagged('primary');
```

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

[](#contributing)

Thank you for considering contributing to this package! Please check the [CONTRIBUTING](CONTRIBUTING.md) file for more details.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance64

Regular maintenance activity

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.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 ~24 days

Recently: every ~17 days

Total

9

Last Release

336d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfd15013ece7b7782813460af6ec7162ca0d9973cc0d9cf5ef3307f5afba0b5a?d=identicon)[Algo Younes](/maintainers/Algo%20Younes)

---

Top Contributors

[![algoyounes](https://avatars.githubusercontent.com/u/45436028?v=4)](https://github.com/algoyounes "algoyounes (34 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")

---

Tags

attribute-basedattribute-bindinglaravelservice-bindinglaraveldependency-injectionpackageservice containerbindifyattribute binding

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/algoyounes-bindify/health.svg)

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

###  Alternatives

[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162145.5k1](/packages/joisarjignesh-bigbluebutton)[threesquared/laravel-paymill

Laravel wrapper for the Paymill API

121.3k](/packages/threesquared-laravel-paymill)

PHPackages © 2026

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