PHPackages                             stoyantodorov/resolve-utilities - 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. stoyantodorov/resolve-utilities

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

stoyantodorov/resolve-utilities
===============================

Laravel Package

1.0.0(2y ago)04MITPHPPHP ^8.1

Since Oct 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/stoyantodorovbg/resolve-utilities)[ Packagist](https://packagist.org/packages/stoyantodorov/resolve-utilities)[ Docs](https://github.com/stoyantodorov/resolve-utilities)[ RSS](/packages/stoyantodorov-resolve-utilities/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (12)Versions (2)Used By (0)

resolve-utilities
=================

[](#resolve-utilities)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3f893192331962b0bf32077851249f01ecabeea7b26175475c5c1fd3a4efe83c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746f79616e746f646f726f762f7265736f6c76652d7574696c69746965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stoyantodorov/resolve-utilities)[![GitHub Tests Action Status](https://camo.githubusercontent.com/603757741ae3df4442e0d65fc2ca0356c0f475edace5c9e287e2f758752cd67e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73746f79616e746f646f726f762f7265736f6c76652d7574696c69746965732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/stoyantodorov/resolve-utilities/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/85052fc8e28f0956c67c3f63931285e63d105ebe84f91d337216319f81471e59/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73746f79616e746f646f726f762f7265736f6c76652d7574696c69746965732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/stoyantodorov/resolve-utilities/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/082dcf984d3c18cbcfa5617e7f998fd514b354d9bda66a29b3753d2e3462b5c3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746f79616e746f646f726f762f7265736f6c76652d7574696c69746965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stoyantodorov/resolve-utilities)

This package offers a way to instantiate a class, to send typed input to it and to receive typed result using a convenient interface:

```
public function useUtility(string $abstract, array $input): mixed
```

That is implemented by `Resolver` class. It takes care to there are no duplicated instances and resets input/output in them before using.
The instantiated class should extend `StoyanTodorov\ResolveUtilities\Utility` - so it is obliged to implement method `execute`:

```
abstract public function execute(): self
```

Тhe data sent to `useUtility` through `array $input` is available as class properties in the instance. The output, that we expect, should be set in `output` property. In this way we may rely on typed input and output without binding the executed code to a certain interface.

Requirements
------------

[](#requirements)

- `PHP 8.1`
- `Laravel`

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

[](#installation)

```
composer require stoyantodorov/resolve-utilities
```

Usage
-----

[](#usage)

##### Extend Utility

[](#extend-utility)

```
use StoyanTodorov\ResolveUtilities\Utility;

class StringOutputExample extends Utility
{
    protected string $output;

    protected string|null $propOne = null;
    protected int|null $propTwo = null;

    protected array $requiredInput = ['propOne'];
    protected array $defaultInput = ['propTwo' => 1];

    public function execute(): Utility
    {
        $this->output = $this->propOne;

        return $this;
    }
}
```

- In `requiredInput` add the properties names which `execute` uses.
- In `defaultInput` add the properties names with theirs default values. When `useUtility` method is called these values are used unless they aren't added to the second parameter.

#### Resolver

[](#resolver)

```
$resolver = new StoyanTodorov\ResolveUtilities\Resolver;
$resultOne = $resolver->useUtility(StringOutputExample::class, ['propOne' => 'test']);
$resultTwo = $resolver->useUtility(StringOutputExample::class, ['propOne' => 'test', 'propTwo' => 100]);
```

- The first parameter sent to `useUtility` may also be an abstract definition like `'single-output-example'`. It will be instantiated if there is such definition in `Laravel`[Service Container](https://laravel.com/docs/10.x/container)

#### HasResolver

[](#hasresolver)

```
use StoyanTodorov\ResolveUtilities\HasResolver;

class ExampleClient
{
    use HasResolver;

    public function test(string $propOne): string
    {
        return $this->useUtility(StringOutputExample::class, compact('propOne'));
    }
}
$result = (new ExampleClient)->test('test');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

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

986d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66155a62cc2992d856c3346a3b36ff35230f06c4464c1212e821f6654b6ef357?d=identicon)[Stoyan\_Todorov](/maintainers/Stoyan_Todorov)

---

Tags

laravelpackagestoyantodorovresolve-utilities

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/stoyantodorov-resolve-utilities/health.svg)

```
[![Health](https://phpackages.com/badges/stoyantodorov-resolve-utilities/health.svg)](https://phpackages.com/packages/stoyantodorov-resolve-utilities)
```

###  Alternatives

[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)

PHPackages © 2026

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