yaangvu / laravel-consul
Laravel Consul
Installs: 11 381
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- dcarbone/php-consul-api: ^1.0
- illuminate/console: ^7|^8|^9|^10
- illuminate/support: ^7|^8|^9|^10
README
Laravel Consul
help you load config from Consul
server
Install
composer require yaangvu/laravel-consul
Laravel
Register service in providers
array in config/app.php
YaangVu\Consul\ConsulProvider::class
Publish consul configuration file
php artisan vendor:publish --provider="YaangVu\Consul\ConsulProvider"
Lumen
Register service in app/Providers/AppServiceProvider.php
public function register() { $this->app->register(\YaangVu\Consul\ConsulProvider::class); }
Publish consul configuration file
cp vendor/yaangvu/laravel-consul/src/consul.php config/consul.php
Config
Append .env
file with these configurations:
CONSUL_ENABLE=true CONSUL_URI=${CONSUL_URI} CONSUL_TOKEN=${CONSUL_TOKEN} CONSUL_SCHEME=${CONSUL_SCHEME} CONSUL_DC=${CONSUL_DC} CONSUL_PATH=${CONSUL_PATH} CONSUL_RECURSIVE=true
Add any Key Folder Consul you want to be loaded
'keys' => [ // 'foo', // 'bar' ],
Get env from Consul
php artisan yaangvu:consul