PHPackages                             pion/laravel-environment-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. pion/laravel-environment-config

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

pion/laravel-environment-config
===============================

App service for loading the config based on environment. Also provides

v1.0.1(10y ago)252MITPHP

Since May 19Pushed 10y ago1 watchersCompare

[ Source](https://github.com/pionl/laravel-environment-config)[ Packagist](https://packagist.org/packages/pion/laravel-environment-config)[ RSS](/packages/pion-laravel-environment-config/feed)WikiDiscussions master Synced today

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

App service config loader
=========================

[](#app-service-config-loader)

Used to load app config, and register the alias and providers, based on environment or custom config by custom usage. In default looks only for local config `app_local.php`. You can enable loading of config based on the current environment (checks if config exists then loads it). More in `AppServiceProvider` and `AppEnvironmentTrait` docs.

You can also load any config file you want at any time you need. Just use a `AppServiceConfigLoaderTrait` and call:

```
// class that uses the trait
// load the admin.php file into our app
$this->registerFromConfig("admin", $this->app);

```

Instalation
-----------

[](#instalation)

```
composer require pion/laravel-environment-config

```

Config structure
----------------

[](#config-structure)

The structure of the config is same like basic app config and should be named with app prefix and the name of the environment: `app_{environment}`The loader supports `alias` and `providers` keys.

### Name examples

[](#name-examples)

- app\_local.php
- app\_production.php

### Example of local with dev tools (require-dev in composer)

[](#example-of-local-with-dev-tools-require-dev-in-composer)

```
