PHPackages                             danjamesmills/config-class-resolver - 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. danjamesmills/config-class-resolver

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

danjamesmills/config-class-resolver
===================================

A Laravel package for resolving classes based on configuration

1.0.0(2y ago)0371MITPHPPHP ^7.3|^8.0

Since Aug 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/DanJamesMills/config-class-resolver)[ Packagist](https://packagist.org/packages/danjamesmills/config-class-resolver)[ Docs](https://github.com/danjamesmills/config-class-resolver)[ RSS](/packages/danjamesmills-config-class-resolver/feed)WikiDiscussions main Synced today

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

Laravel Config Class Resolver
=============================

[](#laravel-config-class-resolver)

A simple Laravel package for resolving classes based on configuration.

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

[](#installation)

Install the package via Composer:

```
composer require danjamesmills/config-class-resolver
```

Usage
-----

[](#usage)

To resolve a class from the configuration, call the `resolve_class_from_config` function with the appropriate parameters:

resolve\_class\_from\_config('your-package-name', 'class');

In the example above, 'your-package-name' represents the main configuration key, and 'class' represents the specific key within that configuration.

If the configuration exists and the class is found, the function will return the resolved class instance. If the class is not found, it will throw a ClassNotFoundException.

Example
-------

[](#example)

Ensure that your configuration file ('config/calls.php') contains the necessary entries for the classes you want to resolve. Here's an example configuration file:

```
return [
    /*
     * Here you can specify which relationship(s) the call model has.
     */
    'associations' => [

        'contact' => [
            'field_key' => 'contact_ids',
            'class' => \DanJamesMills\CRM\Models\Contact::class,
            'relationship_name' => 'contacts',
        ],

        'company' => [
            'field_key' => 'company_ids',
            'class' => \DanJamesMills\CRM\Models\Company::class,
            'relationship_name' => 'companies',
        ],
    ]
]
```

In this example, 'your-package-name' represents the main configuration key. Make sure to replace '\\App\\Models\\YourModel::class' with the appropriate class you want to resolve.

License
-------

[](#license)

This package is open-source software licensed under the MIT license.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1058d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9045fbac486221010088d39798a6a3972091db9a0d40a3c44179ee23a01e743c?d=identicon)[danny620](/maintainers/danny620)

---

Top Contributors

[![DanJamesMills](https://avatars.githubusercontent.com/u/2931604?v=4)](https://github.com/DanJamesMills "DanJamesMills (2 commits)")

---

Tags

configlaravelphplaravelconfigclassresolver

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/danjamesmills-config-class-resolver/health.svg)

```
[![Health](https://phpackages.com/badges/danjamesmills-config-class-resolver/health.svg)](https://phpackages.com/packages/danjamesmills-config-class-resolver)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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