Package Data | |
---|---|
Maintainer Username: | mradcliffe |
Maintainer Contact: | mradcliffe@softpixel.com (Matthew Radcliffe) |
Package Create Date: | 2016-10-17 |
Package Last Update: | 2021-01-20 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-12 15:03:37 |
Package Statistics | |
---|---|
Total Downloads: | 17 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 1 |
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.
composer require mradcliffe/laravel-settings-injector
app/Http/Kernel.php
.\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.app/Console/Kernel.php
and add \Illuminate\Foundation\Console\Kernel::$bootstrappers
protected variables to there, and do the same replacement as in #2 above.See tests
directory for some example fixtures.
settings
directory in app root.settings/settings.php
. See image below.config/*.php
to configure your application.
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.