Apollo configuration management Laravel client
- Laravel Apollo client is implemented based on the HTTP API provided by Apollo
- Laravel's env config mechanism is non-intrusive and can seamlessly access Apollo
- Update configuration files automatically through Command
- Apollo configuration center introduction to the introduction
composer require wujunze/apollo-laravel-client
If you use Laravel < 5.5 run:
php artisan vendor:publish --provider="WuJunze\LaravelApollo\Providers\ServiceProvider"
php artisan vendor:publish
and choose the number matching "WuJunze\LaravelApollo\Providers\ServiceProvider"
provider.
This operation will create config file in config/apollo.php
.
you can change the locale at config/apollo.php
[
//Your env template Just fill it out according to Laravel's env file
'env_tpl' =>
"APP_NAME = {APP_NAME}
APP_ENV = {APP_ENV}
APP_KEY = {APP_KEY}",
'env_dir' => env('ENV_DIR', app_path()),
'env_file' => env('ENV_FILE', '.env'),
'save_dir' => env('SAVE_DIR', storage_path()),
'server' => env('APOLLO_SERVER', 'http://127.0.0.1:8080'),
//Apollo app_id
'app_id' => env('APOLLO_SERVER_APP_ID', 'contract'),
'namespaces' => env('APOLLO_SERVER_APP_ID', ['application']),
// Grayscale published client IP
'client_ip' => env('APOLLO_CLIENT_IP'),
'restart' => env('APOLLO_RESTART', false),
'cluster' => env('APOLLO_CLUSTER', 'default'),
'pull_timeout' => env('APOLLO_PULL_TIMEOUT', 10),
'interval_timeout' => env('APOLLO_INTERVAL_TIMEOUT', 60),
];
run the command
php artisan apollo:update
MIT