faisalilhami/laravel-consul-kv

Package for laravel to connect to consul kv

1.0.2 2024-05-15 21:29 UTC

This package is auto-updated.

Last update: 2024-05-15 21:29:50 UTC


README

Package for help you load config from Consul server

Install

composer require faisalilhami/laravel-consul-kv

Laravel

  1. Register service in providers array in config/app.php if you are using Laravel <= 10
  2. Register service in providers array in boostrap/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