PHPackages                             sikhlana/laravel-singleton - 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. sikhlana/laravel-singleton

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

sikhlana/laravel-singleton
==========================

A simple package to automatically mark a class as singleton.

v2.0.2(1y ago)414.9k↑23.1%MITPHPPHP ^8.0|^7.4

Since Sep 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sikhlana/laravel-singleton)[ Packagist](https://packagist.org/packages/sikhlana/laravel-singleton)[ RSS](/packages/sikhlana-laravel-singleton/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (0)

Automatic singleton binding for Laravel Service Container
=========================================================

[](#automatic-singleton-binding-for-laravel-service-container)

This package makes it easy to define singletons for the service container with just an implementation of a single interface.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Testing](#testing)
- [Changelog](#changelog)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require sikhlana/laravel-singleton
```

If you need to install the service provider manually:

```
// config/app.php
'providers' => [
    ...
    Sikhlana\Singleton\SingletonServiceProvider::class,
],
```

Usage
-----

[](#usage)

All you have to do is make the class you want to use as a singleton implement the `Sikhlana\Singleton\Singleton` interface:

```
use Sikhlana\Singleton\Singleton;

class MySingletonClass implements Singleton
{
    ...
}
```

And voila! You're done.

Testing
-------

[](#testing)

You can do unit tests by running:

```
vendor/bin/phpunit
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Security
--------

[](#security)

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

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Saif Mahmud](https://github.com/sikhlana)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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

Every ~209 days

Recently: every ~148 days

Total

10

Last Release

603d ago

Major Versions

v1.0.5 → v2.0.02024-06-16

PHP version history (3 changes)v1.0.0PHP ^7.1

v1.0.3PHP ^8.0|^7.3

v2.0.0PHP ^8.0|^7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1730777?v=4)[Saif Mahmud](/maintainers/sikhlana)[@sikhlana](https://github.com/sikhlana)

---

Top Contributors

[![sikhlana](https://avatars.githubusercontent.com/u/1730777?v=4)](https://github.com/sikhlana "sikhlana (17 commits)")

---

Tags

dependency-injectionioc-containerlaravellaraveldependency-injectionpackageiocsingleton

### Embed Badge

![Health badge](/badges/sikhlana-laravel-singleton/health.svg)

```
[![Health](https://phpackages.com/badges/sikhlana-laravel-singleton/health.svg)](https://phpackages.com/packages/sikhlana-laravel-singleton)
```

###  Alternatives

[firefly-iii/data-importer

Firefly III Data Import Tool.

8035.8k](/packages/firefly-iii-data-importer)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[creasi/laravel-nusa

A Laravel package that aim to provide Indonesia' Administrative Data

997.9k2](/packages/creasi-laravel-nusa)[ronasit/laravel-helpers

Provided helpers function and some helper class.

2085.6k31](/packages/ronasit-laravel-helpers)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[pdazcom/laravel-referrals

A referrals system for a laravel projects.

291.5k](/packages/pdazcom-laravel-referrals)

PHPackages © 2026

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