PHPackages                             decodelabs/dovetail - 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. decodelabs/dovetail

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

decodelabs/dovetail
===================

Comprehensive config solution

v0.3.6(7mo ago)06.6k6MITPHPPHP ^8.4CI passing

Since Oct 17Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/decodelabs/dovetail)[ Packagist](https://packagist.org/packages/decodelabs/dovetail)[ RSS](/packages/decodelabs-dovetail/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (31)Used By (6)

Dovetail
========

[](#dovetail)

[![PHP from Packagist](https://camo.githubusercontent.com/e0164b02d40df7aa265700af568c0cd6afb6166327cb86c4198a8034a39a2aad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6465636f64656c6162732f646f76657461696c3f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/dovetail)[![Latest Version](https://camo.githubusercontent.com/634a2b9aa9258e32a3927a2e455ade5bfbe1200e2cf3d60c966d5b9fa87353f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465636f64656c6162732f646f76657461696c2e7376673f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/dovetail)[![Total Downloads](https://camo.githubusercontent.com/2fc788ed7779d08e4fd71d37b33c612c197adb8ff48eb8a2d401d1bd6d3040ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465636f64656c6162732f646f76657461696c2e7376673f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/dovetail)[![GitHub Workflow Status](https://camo.githubusercontent.com/98867ef1f171a72e24d2b3bb437652780003235e69de3d4f75625fef43e181d7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6465636f64656c6162732f646f76657461696c2f696e746567726174652e796d6c3f6272616e63683d646576656c6f70)](https://github.com/decodelabs/dovetail/actions/workflows/integrate.yml)[![PHPStan](https://camo.githubusercontent.com/e25c14ce011edabdd0fbd2e10415b41cc5d66ed11ef3e5b7edd074c5bdd35a2d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d3434434331312e7376673f6c6f6e6743616368653d74727565267374796c653d666c6174)](https://github.com/phpstan/phpstan)[![License](https://camo.githubusercontent.com/0853c6855b5b045baae27ec52d43691735118d8f8366b4bbe5685ed14d13754a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465636f64656c6162732f646f76657461696c3f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/dovetail)

### Comprehensive config solution for PHP

[](#comprehensive-config-solution-for-php)

Dovetail provides a simple, flexible and powerful way to manage configuration data in PHP applications.

---

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

[](#installation)

This package requires PHP 8.4 or higher.

Install via Composer:

```
composer require decodelabs/dovetail
```

Usage
-----

[](#usage)

### Env

[](#env)

Dovetail utilises [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv) to load environment variables from a `.env` file in your project root. This is automatically loaded when you first access the Dovetail service.

```
use DecodeLabs\Dovetail\Env;

$dbHost = Env::asString('DB_HOST', 'localhost'); // String
$dbPort = Env::asInt('DB_PORT', 3306); // Int
$debug = Env::asBool('DEBUG', false); // Bool
$test = Env::asString('TEST', 'default'); // Mixed
```

Use `Env::try*()` methods to avoid throwing exceptions when the environment variable is not set and no default value is provided.

### Config

[](#config)

Dovetail provides structures to allow loading config files from any custom location, into `Repository` container tree objects, and presented in domain specific `Config` objects which can then provide custom data access methods according to your needs.

Sensitive data should be loaded from a `.env` file and not stored in config files - use the `Env::as*()` and `Env::try*()` methods to inject these values into your config.

```
# config/database.php
use DecodeLabs\Dovetail\Env;

return [
    'adapter' => 'mysql',
    'host' => Env::asString('DB_HOST', 'localhost'),
    'port' => Env::asInt('DB_PORT', 3306),
];
```

```
# app/Config/Database.php
use DecodeLabs\Dovetail\Config;
use DecodeLabs\Dovetail\ConfigTrait;

class Database implements Config
{
    use ConfigTrait;

    public function getAdapter(): string
    {
        return $this->data['adapter'] ?? 'mysql';
    }

    public function getHost(): string
    {
        return $this->data['host'] ?? 'localhost';
    }

    public function getPort(): int
    {
        return $this->data['port'] ?? 3306;
    }
}
```

```
use DecodeLabs\Dovetail;
use DecodeLabs\Monarch;

$dovetail = Monarch::getService(Dovetail::class);
$config = $dovetail->load('database');
$adapter = $config->getAdapter(); // 'mysql'
```

Licensing
---------

[](#licensing)

Dovetail is licensed under the proprietary License. See [LICENSE](./LICENSE) for the full license text.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance67

Regular maintenance activity

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

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 ~25 days

Recently: every ~11 days

Total

29

Last Release

223d ago

PHP version history (2 changes)v0.1.0PHP ^8.1

v0.2.9PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a241d64d12b3b5ee94197862ec1ec30b82ed2efa34a0cd7f4c3565a021daddd?d=identicon)[betterthanclay](/maintainers/betterthanclay)

---

Top Contributors

[![betterthanclay](https://avatars.githubusercontent.com/u/1273586?v=4)](https://github.com/betterthanclay "betterthanclay (128 commits)")

---

Tags

configenvphp

### Embed Badge

![Health badge](/badges/decodelabs-dovetail/health.svg)

```
[![Health](https://phpackages.com/badges/decodelabs-dovetail/health.svg)](https://phpackages.com/packages/decodelabs-dovetail)
```

###  Alternatives

[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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