2017 © Pedro Peláez
 

library option

Save and retreive config from db for laravel 5 / Access Config as Array

image

weboap/option

Save and retreive config from db for laravel 5 / Access Config as Array

  • Wednesday, August 12, 2015
  • by weboap
  • Repository
  • 0 Watchers
  • 5 Stars
  • 245 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

#Option

Save and retreive config from db for laravel / Access Config as Array, (*1)

Laravel 4 users use "weboap/option": "v1.0.5", (*2)

Installation

The recommended way to install Winput is through composer., (*3)

Step 1

php composer require weboap/option

Step 2 (optional)

Add config/app.php if you are using laravel <5.5, (*4)

``` php 'Weboap\Option\OptionServiceProvider', (*5)




## Step 3 Migrate the Option Table Run ``` php php artisan vendor:publish php artisan migrate

you can check app/option.php to costumize Option config file., (*6)

Usage

Note : the keys are to be set group.key (eg: 'gallery.path', 'cache.timeout') that way the options are grouped per categories keys that don't have a group the package will prepend 'global.' to eg: seting a key : 'business' will be retreived like 'global.business', (*7)

``` php, (*8)

//set one key Option::set('group.key', 'value');, (*9)

// or set an array of key, values Option::set(['key0'=> 'value', 'group.key'=>'value', 'someothergroup.key1'=>'value1', .....]);, (*10)

Option::get('group.key'); Option::get('global.key');, (*11)

Option::group('prefix'); // will return an array of options prefixed with group, (*12)

Option::forget('group.key');, (*13)

Option::has('group.key');, (*14)

//retreive all keys, values at once Option::all();, (*15)

or, (*16)

you can access config as array like, (*17)

$config = App::make('option');, (*18)

$config['mygroup.foo'] = 'bar';, (*19)

echo $config['mygroup.foo'];, (*20)

unset($config['mygroup.foo']);, (*21)

```, (*22)

Enjoy!, (*23)

The Versions

12/08 2015

dev-master

9999999-dev

Save and retreive config from db for laravel 5 / Access Config as Array

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

by Avatar weboap

framework configuration laravel 5 option

12/08 2015

v2.0.3

2.0.3.0

Save and retreive config from db for laravel 5 / Access Config as Array

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

by Avatar weboap

framework configuration laravel 5 option

22/06 2015

v2.0.2

2.0.2.0

Save and retreive config from db for laravel 5 / Access Config as Array

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

by Avatar weboap

framework configuration laravel 5 option

10/05 2015

v2.0.1

2.0.1.0

Save and retreive config from db for laravel 5 / Access Config as Array

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Avatar weboap

framework configuration laravel 5 option

08/05 2015

v2.0.0

2.0.0.0

Save and retreive config from db for laravel 5 / Access Config as Array

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Avatar weboap

framework configuration laravel 5 option

27/04 2015

v1.0.5

1.0.5.0

Save and retreive config from db for laravel 4 / Access Config as Array

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar weboap

framework configuration laravel 4 option

15/04 2014

1.0.3

1.0.3.0

Save and retreive config from db for laravel 4 / Access Config as Array

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar weboap

framework configuration laravel 4 option

04/04 2014

1.0.2

1.0.2.0

Save and retreive config from db for laravel 4 / Access Config as Array

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar weboap

framework configuration laravel 4 option

07/02 2014

1.0.1

1.0.1.0

Save and retreive config from db for laravel 4

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar weboap