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. [Utility &amp; Helpers](/categories/utility)
4. /
5. laravel-tools/lazy-dependency

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

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 today

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 26% 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

838d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3853663?v=4)[Rafał Łempa](/maintainers/rlempa)[@rlempa](https://github.com/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)
```

###  Alternatives

[danog/class-finder

Fork of haydenpierce/class-finder with support for traits, interfaces and functions

12149.7k3](/packages/danog-class-finder)[virusphp/bridging-bpjs

Service Briding Bpjs

434.1k](/packages/virusphp-bridging-bpjs)[rotexsoft/versatile-collections

A collection package that can be extended to implement things such as a Dependency Injection Container, RecordSet objects for housing database records, a bag of http cookies, or technically any collection of items that can be looped over and whose items can each be accessed using array-access syntax or object property syntax.

186.1k1](/packages/rotexsoft-versatile-collections)[oxid-esales/evat-module

This is eVat module for OXID eShop.

193.3k](/packages/oxid-esales-evat-module)

PHPackages © 2026

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