PHPackages                             laravel-tools/lazy-dependency - 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. laravel-tools/lazy-dependency

AbandonedArchivedLibrary

laravel-tools/lazy-dependency
=============================

This package provides a possibility to lazy load dependencies using attribute.

v2024.1.0(2y ago)03MITPHPPHP ^8.3

Since Mar 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/laravel-tools/lazy-dependency)[ Packagist](https://packagist.org/packages/laravel-tools/lazy-dependency)[ Docs](https://github.com/laravel-tools/lazy-dependency)[ RSS](/packages/laravel-tools-lazy-dependency/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel Tools - Lazy Dependency
===============================

[](#laravel-tools---lazy-dependency)

This package provides a possibility to lazy load dependencies using attribute.

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

[](#installation)

You can install the package via composer:

```
composer require laravel-tools/lazy-dependency
```

### Security

[](#security)

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

Usage
-----

[](#usage)

Trait is required to be used. Recommended way is to create base abstract class for Controller, Services etc. and use that trait in that base class.

```
new class {
    use UseDependency;

    #[Dependency]
    readonly protected ExampleClass $service;

    public function hello(): string
    {
        return $this->service->hello();
    }
};
```

Development
-----------

[](#development)

To start developing first you must install the dependencies:

```
docker run --rm -v $(pwd):/app composer install
```

### Testing

[](#testing)

To test the package you can run:

```
docker run --rm -v $(pwd):/app -w /app php:8.3-cli vendor/bin/pest
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

785d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/756f018c495d3cc572049b8b59a3ce2e57d8be8bf51fdfd778a5590673ddb5db?d=identicon)[rlempa](/maintainers/rlempa)

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/laravel-tools-lazy-dependency/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-tools-lazy-dependency/health.svg)](https://phpackages.com/packages/laravel-tools-lazy-dependency)
```

PHPackages © 2026

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