faisalilhami / laravel-consul-kv
Package for laravel to connect to consul kv
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/faisalilhami/laravel-consul-kv
Requires
- dcarbone/php-consul-api: ^2.0
- illuminate/console: ^7|^8|^9|^10|^11
- illuminate/support: ^7|^8|^9|^10|^11
README
Package for help you load config from Consul
server
Install
composer require faisalilhami/laravel-consul-kv
Laravel
- Register service in
providers
array inconfig/app.php
if you are using Laravel <= 10 - Register service in
providers
array inboostrap/providers.php
if you are using Laravel >= 11
Faisalilhami\LaravelConsulKv\Provider::class
Publish consul configuration file
php artisan vendor:publish --provider="Faisalilhami\LaravelConsulKv\Provider"
Publish consul configuration file
cp vendor/faisalilhami/laravel-consul-kv/src/consul.php config/consul.php
Config
Create .env
file with these configurations:
CONSUL_ENABLE=true CONSUL_URI= CONSUL_TOKEN= CONSUL_SCHEME= CONSUL_DC= CONSUL_PATH= CONSUL_RECURSIVE=true
Add any Key Folder Consul you want to be loaded
'keys' => [ // 'foo', // 'bar' ],
Get env from Consul
php artisan get:consul