YaangVu / laravel-consul by YaangVu

Laravel Consul
11,262
3
2
Package Data
Maintainer Username: YaangVu
Maintainer Contact: yaangvu@gmail.com (Yaang Vu)
Package Create Date: 2021-05-20
Package Last Update: 2023-03-26
Language: PHP
License: MIT
Last Refreshed: 2024-12-15 15:12:49
Package Statistics
Total Downloads: 11,262
Monthly Downloads: 501
Daily Downloads: 5
Total Stars: 3
Total Watchers: 2
Total Forks: 2
Total Open Issues: 0

Laravel Consul

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}

Add any Key Folder Consul you want to be loaded

'keys'   => [
        // 'foo',
        // 'bar'
    ],