PHPackages                             phanan/cascading-config - 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. phanan/cascading-config

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

phanan/cascading-config
=======================

Bringing the cascading configuration system back to Laravel 5.

2.0.0(10y ago)55150.4k↓20.8%7[2 PRs](https://github.com/phanan/cascading-config/pulls)1MITPHP

Since Apr 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/phanan/cascading-config)[ Packagist](https://packagist.org/packages/phanan/cascading-config)[ Docs](https://github.com/phanan/cascading-config)[ RSS](/packages/phanan-cascading-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (8)Used By (1)

Cascading Config
================

[](#cascading-config)

[![Build Status](https://camo.githubusercontent.com/5503d5153e2b3720b23f19d07db4cf6f56d3d7bcdd6270f19e851ea4c714d8b7/68747470733a2f2f7472617669732d63692e6f72672f7068616e616e2f636173636164696e672d636f6e6669672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phanan/cascading-config)[![Dependency Status](https://camo.githubusercontent.com/b84e4786c1e158454ede1502558f5f4a1f659f325c1660f3824848cf469e8020/68747470733a2f2f67656d6e617369756d2e636f6d2f7068616e616e2f636173636164696e672d636f6e6669672e737667)](https://gemnasium.com/phanan/cascading-config)[![License](https://camo.githubusercontent.com/60608b97437eb26f6f84c3fc67e5f89a2ee0d1630c35ab9fbf42aa39ead1a4b9/68747470733a2f2f706f7365722e707567782e6f72672f7068616e616e2f636173636164696e672d636f6e6669672f6c6963656e73652e737667)](https://packagist.org/packages/phanan/cascading-config)

A simple package that brings the cascading configuration system back into Laravel 5 and its sister project, Lumen.

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

[](#requirements)

- Laravel 5, or
- Lumen &gt;=5.1

Features
--------

[](#features)

- Laravel-4 style cascading config (can't believe I'm writing this)
- [Nested configuration](https://github.com/laravel/framework/commit/fee982004a795058ab6a66e1600c11aac6748acf) is fully supported

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

[](#installation)

First, require `phanan/cascading-config` into your `composer.json` and run `composer update`:

```
    "require": {
        "phanan/cascading-config": "~2.0"
    },

```

An environment-based configuration directory should have a name with this format `config.{APP_ENV}`, and reside in the same directory as the default `config` dir. For Laravel, `php artisan vendor:publish`will create a sample directory for your `local` environment. For Lumen, you'll have to create the directories manually.

Your application structure now should have something like this:

```
config
├── app.php
├── auth.php
├── cache.php
├── compile.php
├── database.php
├── mail.php
└── ...
config.local
├── app.php
├── auth.php
├── cache.php
├── mail.php
└── nested
    └── app.php

```

Fill the configuration into your environment-based config directory (`config.local`, `config.staging`, `config.production`), just like what you've always done in Laravel 4,

Usage
-----

[](#usage)

### For Laravel

[](#for-laravel)

1. Add the package's service provider class into `config/app.php`:

    ```
    'providers' => [
        /*
         * ...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,

        PhanAn\CascadingConfig\CascadingConfigServiceProvider::class,
    ],
    ```
2. Call `config($key)`

### For Lumen

[](#for-lumen)

1. Register the service provider class in `bootstrap/app.php`:

    ```
    // $app->register(App\Providers\AppServiceProvider::class);
    // $app->register(App\Providers\EventServiceProvider::class);
    $app->register(PhanAn\CascadingConfig\CascadingConfigServiceProvider::class);
    ```
2. Enable multi-environment support by uncommenting this line:

    ```
    Dotenv::load(__DIR__.'/../');
    ```
3. Manually register the configuration arrays:

    ```
    $app->configure('auth');
    $app->configure('cache');
    $app->configure('mail');
    ```
4. Call `config($key)`

Notes
-----

[](#notes)

Because of the way `array_merge_recursive()` works, a config key with value being an indexed (non-associative) array (for instance, `app.providers`) will have the value's items overridden. See [\#6](https://github.com/phanan/cascading-config/issues/6) for more details on this behavior, and how to work around it.

License
-------

[](#license)

MIT © [Phan An](http://phanan.net)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 69.2% 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 ~72 days

Total

4

Last Release

3836d ago

Major Versions

1.0.3 → 2.0.02015-11-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf42e22d8fba4d5475bd6dae13887c897bbdaa99765b209010c09b7fc1f3aef7?d=identicon)[phanan](/maintainers/phanan)

---

Top Contributors

[![phanan](https://avatars.githubusercontent.com/u/8056274?v=4)](https://github.com/phanan "phanan (9 commits)")[![halfer](https://avatars.githubusercontent.com/u/480975?v=4)](https://github.com/halfer "halfer (2 commits)")[![albertosabena](https://avatars.githubusercontent.com/u/11071710?v=4)](https://github.com/albertosabena "albertosabena (1 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (1 commits)")

---

Tags

laravelconfigurationconfiglaravel 5cascadingcascade

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phanan-cascading-config/health.svg)

```
[![Health](https://phpackages.com/badges/phanan-cascading-config/health.svg)](https://phpackages.com/packages/phanan-cascading-config)
```

###  Alternatives

[akaunting/laravel-setting

Persistent settings package for Laravel

495805.1k7](/packages/akaunting-laravel-setting)[illuminatech/array-factory

Allows DI aware object creation from array definition

2159.6k6](/packages/illuminatech-array-factory)

PHPackages © 2026

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