wujunze / apollo-laravel-client
Laravel apollo configuration-management client
1.0.3
2019-01-04 03:53 UTC
Requires
- php: ^7.1
- laravel/framework: 5.*
- nicmart/string-template: ^0.1.1
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.23.3
- mockery/mockery: ^1.2
- phpunit/phpunit: ^7.4
This package is not auto-updated.
Last update: 2024-12-14 12:27:02 UTC
README
Apollo configuration management Laravel client
Features
- 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
Install
composer require wujunze/apollo-laravel-client
in your console to publish default configuration files.
If you use Laravel < 5.5 run:
php artisan vendor:publish --provider="WuJunze\LaravelApollo\Providers\ServiceProvider"
If you are using Laravel 5.5 run:
php artisan vendor:publish
and choose the number matching "WuJunze\LaravelApollo\Providers\ServiceProvider"
provider.
This operation will create config file in config/apollo.php
.
Configuration
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), ];
Usage
run the command
php artisan apollo:update
Inspiration and Thanks
License
MIT