2017 © Pedro Peláez
 

library laravel-config

A basic laravel runtime configuration handler that is stored as simple key/values.

image

benrowe/laravel-config

A basic laravel runtime configuration handler that is stored as simple key/values.

  • Saturday, June 11, 2016
  • by benrowe
  • Repository
  • 2 Watchers
  • 1 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Laravel Config

Build Status Scrutinizer Code Quality Total Downloads Latest Stable Version Latest Unstable Version License, (*1)

A Laravel runtime configuration handler that supports hierarchical configuration, however when stored, the data is flattened to basic key/value pairs (this allows for more possible storage options), (*2)

<?php

use Benrowe\Laravel\Config\Config;

$config = new Config([
    'foo.bar[0]' => 'Hello',
    'foo.bar[1]' => 'World',
    'foo.key'    => 'Value'
]);

$foo = $config->get('foo'); // => ['bar' => ['Hello', 'World'], 'key' => 'Value']
$bar = $config->get('foo.bar'); // => ['Hello', 'World']

Features

  • Ability to store the configuration data into any persistent data store (file, db, etc).
    • Provided Storage Adapters include Db, File, Redis.
  • Dot notation syntax for configuration hierarchy.
  • Values can be simple strings, or arrays of strings.
  • Modifier support. Modifers can be registered to manipulate the value at runtime. (aka storing json, datetimes, booleans, etc).
  • [ServiceProvider][2] included to configure the component based on the supplied configuration
  • Facade support

Installation

Install the library using composer. Add the following to your composer.json:, (*3)

{
    "require": {
        "benrowe/laravel-config": "0.1.*"
    }
}

Now run the install command., (*4)

$ composer.phar install

This will provide access to the component via PSR-4. To configure the package as a laravel service, the service provider must be registered with the provided ServiceProvider., (*5)

Configuring Laravel

Once the package has been installed via composer, you need to register the service provider. To do this, edit your config/app.php and add a new option under the providers key., (*6)

Benrowe\Laravel\Config\ServiceProvider::class

Additionally you can register the provided facade., (*7)

'RuntimeConfig' => Benrowe\Laravel\Config\Facdes\Config::class,

With the service provider registered, this will give access to the config component, however it is not configured to persist any changes you make to the config. To do this, you need to publish the provided config file., (*8)

php artisan vendor:publish --provider="Benrowe\Laravel\Config\ServiceProvider" --tag="config"

This will publish a config.php file into your config directory. At this point you will need to edit the file and setup how you want to persist your configuration., (*9)

Additionally if you plan to store your configuration in a database (such as mysql, etc) you will need to publish the migration which stores the config schema, (*10)

php artisan vendor:publish --provider="Benrowe\Laravel\Config\ServiceProvider" --tag="migrations"

The Versions

11/06 2016

dev-master

9999999-dev http://benrowe.info

A basic laravel runtime configuration handler that is stored as simple key/values.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel read write config filter

10/06 2016

v0.2

0.2.0.0 http://benrowe.info

A basic laravel runtime configuration handler that is stored as simple key/values.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel read write config filter

13/05 2016

v0.1.1

0.1.1.0

A basic laravel runtime configuration handler that is stored as simple key/values.

  Sources   Download

MIT

The Requires

 

The Development Requires

12/05 2016

v0.1

0.1.0.0

A basic laravel runtime configuration handler that is stored as simple key/values.

  Sources   Download

MIT

The Requires

 

The Development Requires