orchestra/config
Configuration Component for Laravel and Orchestra Platform
Config Component is a configuration with environment based support for Laravel 5 and above. The component is actually based from Laravel 4 configuration.
Table of Content
Version Compatibility
| Laravel | Config |
|---|---|
| 5.5.x | 3.5.x |
| 5.6.x. | 3.6.x |
| 5.7.x. | 3.7.x |
| 5.8.x | 3.8.x |
| 6.x | 4.x |
| 7.x | 5.x |
Installation
To install through composer, run the following command from terminal:
composer require "orchestra/config"
Configuration
To swap Laravel 5 default configuration, all you need to do is add the following code to bootstrap/app.php:
$app->singleton(
Illuminate\Foundation\Bootstrap\LoadConfiguration::class,
Orchestra\Config\Bootstrap\LoadConfiguration::class
);
Configuration Caching Support
Config Component also bring an enhanced php artisan config:cache support to speed up configuration loading, some features include:
- Caching packages/namespaced config instead of just application
configdirectory. - Enforcing lazy loaded packages config by including list of packages config key in
compile.config.
In order to do this you need to replace Illuminate\Foundation\Provider\ArtisanServiceProvider with a new App\Providers\ArtisanServiceProvider:
<?php namespace App\Providers;
use Orchestra\Config\Console\ConfigCacheCommand;
use Illuminate\Foundation\Providers\ArtisanServiceProvider as ServiceProvider;
class ArtisanServiceProvider extends ServiceProvider
{
/**
* Register the command.
*
* @return void
*/
protected function registerConfigCacheCommand()
{
$this->app->singleton('command.config.cache', function ($app) {
return new ConfigCacheCommand($app['files']);
});
}
}
Don't forget to update your
config/app.phpto replacesIlluminate\Foundation\Provider\ArtisanServiceProviderwithApp\Providers\ArtisanServiceProvider.
Caching lazy loaded packages file
In order to force certain packages to be included in config caching, you can specify either the relative key of desired packages in your config/compile.php file:
<?php
return [
// ...
'config' => [
'orchestra/foundation::config', // if package config is group under "config/config.php"
'orchestra/foundation::roles', // Using one of the key available in "config/config.php"
'orchestra/html::form', // When package contain "config/form.php"
],
];
Related Packages
Support (Providers) Component for Laravel and Orchestra Platform
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v6.0.0 | ^7.3 | | ^8.0 | MIT | |
| v5.1.0 | >=7.2 | ^7.0 | MIT | |
| v5.0.0 | >=7.2 | ^7.0 | MIT | |
| v4.3.0 | >=7.2 | ^6.0 | MIT | |
| v4.2.0 | >=7.2 | ^6.0 | MIT | |
| v4.1.0 | >=7.2 | ^6.0 | MIT | |
| v4.0.1 | >=7.2 | ^6.0 | MIT | |
| v4.0.0 | >=7.2 | ^6.0 | MIT | |
| v3.8.4 | >=7.1 | ~5.8.0 | MIT | |
| v3.8.3 | >=7.1 | ~5.8.0 | MIT | |
| v3.8.2 | >=7.1 | ~5.8.0 | MIT | |
| v3.8.1 | >=7.1 | ~5.8.0 | MIT | |
| v3.8.0 | >=7.1 | ~5.8.0 | MIT | |
| v3.7.1 | >=7.1 | ~5.7.0 | MIT | |
| v3.7.0 | >=7.1 | ~5.7.0 | MIT | |
| v3.6.2 | >=7.1 | ~5.6.0 | MIT | |
| v3.6.1 | >=7.1 | ~5.6.0 | MIT | |
| v3.6.0 | >=7.1 | ~5.6.0 | MIT | |
| v3.5.3 | >=7.0 | ~5.5.0 | MIT | |
| v3.5.2 | >=7.0 | ~5.5.0 | MIT | |
| v3.5.1 | >=7.0 | ~5.5.0 | MIT | |
| v3.5.0 | >=7.0 | ~5.5.0 | MIT | |
| v3.4.4 | >=5.6.0 | ~5.4.0 | MIT | |
| v3.4.3 | >=5.6.0 | ~5.4.0 | MIT | |
| v3.4.2 | >=5.6.0 | ~5.4.0 | MIT | |
| v3.4.1 | >=5.6.0 | ~5.4.0 | MIT | |
| v3.4.0 | >=5.6.0 | ~5.4.0 | MIT | |
| v3.3.6 | >=5.6.0 | ~5.3.0 | MIT | |
| v3.3.5 | >=5.6.0 | ~5.3.0 | MIT | |
| v3.3.3 | >=5.6.0 | ~5.3.0 | MIT |
Showing the latest 30 of 59. See every release on Packagist
Pre-releases (3)
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v3.6.0-BETA1 | >=7.1 | ~5.6.0 | MIT | |
| v3.4.0-BETA2 | >=5.6.0 | ~5.4.0 | MIT | |
| v3.4.0-BETA1 | >=5.6.0 | ~5.4.0 | MIT |