PHPackages                             mradcliffe/laravel-settings-injector - 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. mradcliffe/laravel-settings-injector

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

mradcliffe/laravel-settings-injector
====================================

Laravel Settings Injector

0.2.1(9y ago)118[1 issues](https://github.com/mradcliffe/laravel-settings-injector/issues)MITPHPCI failing

Since Oct 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mradcliffe/laravel-settings-injector)[ Packagist](https://packagist.org/packages/mradcliffe/laravel-settings-injector)[ Docs](https://github.com/mradcliffe/laravel-settings-injector)[ RSS](/packages/mradcliffe-laravel-settings-injector/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Laravel Settings Injector
=========================

[](#laravel-settings-injector)

[![Build Status](https://camo.githubusercontent.com/4066efb8c3938cd8b6bd722d3df93db074c182e413933c344839b6a18da5a321/68747470733a2f2f7472617669732d63692e6f72672f6d726164636c696666652f6c61726176656c2d73657474696e67732d696e6a6563746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mradcliffe/laravel-settings-injector)

laravel-settings-injector provides a bootstrapper replacement for the default LoadConfiguration bootstrapper from Laravel.

This allows you to create a directory to manage settings from outside of the application directory with symlinks so that various environment-specific variables can be managed at a systems-level for production and other internal enviroments.

This is probably not useful for many installations of Laravel, however due to recommendations of not using dotenv files for production environment variables this is necessary to obfuscate production variables from the application repository. The advantage is that the variables are scoped to LoadConfiguration instead of using global environment variables.

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

[](#installation)

```
composer require mradcliffe/laravel-settings-injector
```

Configuration
-------------

[](#configuration)

1. Modify `app/Http/Kernel.php`.
2. Replace `\Illuminate\Foundation\Bootstrap\LoadConfiguration` with `\Radcliffe\LaravelSettingsInjector\Bootstrap\LoadConfiguration` either by modifying an existing `::$bootstrappers` protected variable or doing so within the `::bootstrappers()` method of that class.
3. Modify `app/Console/Kernel.php` and add `\Illuminate\Foundation\Console\Kernel::$bootstrappers` protected variables to there, and do the same replacement as in #2 above.

Usage
-----

[](#usage)

See `tests` directory for some example fixtures.

1. Create a `settings` directory in app root.
2. Provision files outside of the webroot, but required somehow by `settings/settings.php`. See image below.
3. Use those variables as normal in `config/*.php` to configure your application.
    - Note that any defines or requires could potentially happen more than once due to the way that Laravel works. Specifically `artisan config:cache` will load configuration after configuration has already been loaded so any use of `define` or `require` within `settings/settings.php` or any file it requires needs to take that into consideratino.

[![Example Configuration](docs/example.png?raw=true "Example Configuration")](docs/example.png?raw=true)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Every ~2 days

Total

3

Last Release

3491d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a9b59b512e724e913b2dfe1a10f7e70dbf7f60dc00330c7be2478159ced9061?d=identicon)[mradcliffe](/maintainers/mradcliffe)

---

Top Contributors

[![mradcliffe](https://avatars.githubusercontent.com/u/328497?v=4)](https://github.com/mradcliffe "mradcliffe (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mradcliffe-laravel-settings-injector/health.svg)

```
[![Health](https://phpackages.com/badges/mradcliffe-laravel-settings-injector/health.svg)](https://phpackages.com/packages/mradcliffe-laravel-settings-injector)
```

###  Alternatives

[fmasa/auto-di

1522.2k](/packages/fmasa-auto-di)[petrgrishin/array-map

The object oriented approach to working with arrays on PHP

125.8k1](/packages/petrgrishin-array-map)

PHPackages © 2026

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