YaangVu / laravel-consul by YaangVu

Laravel Consul
6,522
2
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-04-18 15:16:51
Package Statistics
Total Downloads: 6,522
Monthly Downloads: 267
Daily Downloads: 25
Total Stars: 2
Total Watchers: 2
Total Forks: 1
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'
    ],